Remove broken checks from providers

The latest python-neutronclient doesn't show confirmation messages anymore,
errors will be caught anyway as the client will return non-zero code

Change-Id: Id291e158f7181adede1c3876b412132a63188f83
This commit is contained in:
Sergey Kolekonov 2016-03-09 17:15:07 +03:00
parent 7fa9aaac49
commit 0402147fe0
5 changed files with 66 additions and 93 deletions

View File

@ -102,7 +102,6 @@ Puppet::Type.type(:neutron_network).provide(
results = auth_neutron('net-create', '--format=shell', results = auth_neutron('net-create', '--format=shell',
network_opts, resource[:name]) network_opts, resource[:name])
if results =~ /Created a new network:/
attrs = self.class.parse_creation_output(results) attrs = self.class.parse_creation_output(results)
@property_hash = { @property_hash = {
:ensure => :present, :ensure => :present,
@ -116,9 +115,6 @@ Puppet::Type.type(:neutron_network).provide(
:shared => attrs['shared'], :shared => attrs['shared'],
:tenant_id => attrs['tenant_id'], :tenant_id => attrs['tenant_id'],
} }
else
fail("did not get expected message on network creation, got #{results}")
end
end end
def destroy def destroy

View File

@ -88,7 +88,6 @@ Puppet::Type.type(:neutron_port).provide(
resource[:network_name] resource[:network_name]
) )
if results =~ /Created a new port:/
attrs = self.class.parse_creation_output(results) attrs = self.class.parse_creation_output(results)
@property_hash = { @property_hash = {
:ensure => :present, :ensure => :present,
@ -103,9 +102,6 @@ Puppet::Type.type(:neutron_port).provide(
:subnet_id => self.class.parse_subnet_id(attrs["fixed_ips"]), :subnet_id => self.class.parse_subnet_id(attrs["fixed_ips"]),
:ip_address => self.class.parse_ip_address(attrs["fixed_ips"]) :ip_address => self.class.parse_ip_address(attrs["fixed_ips"])
} }
else
fail("did not get expected message on port creation, got #{results}")
end
end end
def destroy def destroy

View File

@ -86,7 +86,6 @@ Puppet::Type.type(:neutron_router).provide(
results = auth_neutron("router-create", '--format=shell', results = auth_neutron("router-create", '--format=shell',
opts, resource[:name]) opts, resource[:name])
if results =~ /Created a new router:/
attrs = self.class.parse_creation_output(results) attrs = self.class.parse_creation_output(results)
@property_hash = { @property_hash = {
:ensure => :present, :ensure => :present,
@ -102,20 +101,10 @@ Puppet::Type.type(:neutron_router).provide(
results = auth_neutron('router-gateway-set', results = auth_neutron('router-gateway-set',
@resource[:name], @resource[:name],
@resource[:gateway_network_name]) @resource[:gateway_network_name])
if results =~ /Set gateway for router/
attrs = self.class.get_neutron_resource_attrs('router', attrs = self.class.get_neutron_resource_attrs('router',
@resource[:name]) @resource[:name])
@property_hash[:external_gateway_info] = \ @property_hash[:external_gateway_info] = \
attrs['external_gateway_info'] attrs['external_gateway_info']
else
fail(<<-EOT
did not get expected message on setting router gateway, got #{results}
EOT
)
end
end
else
fail("did not get expected message on router creation, got #{results}")
end end
end end

View File

@ -67,14 +67,10 @@ Puppet::Type.type(:neutron_router_interface).provide(
end end
results = auth_neutron(args) results = auth_neutron(args)
if results =~ /Added interface.* to router/
@property_hash = { @property_hash = {
:ensure => :present, :ensure => :present,
:name => resource[:name], :name => resource[:name],
} }
else
fail("did not get expected message on interface addition, got #{results}")
end
end end
def router_name def router_name

View File

@ -168,7 +168,6 @@ Puppet::Type.type(:neutron_subnet).provide(
results = auth_neutron('subnet-create', '--format=shell', results = auth_neutron('subnet-create', '--format=shell',
opts, resource[:cidr]) opts, resource[:cidr])
if results =~ /Created a new subnet:/
attrs = self.class.parse_creation_output(results) attrs = self.class.parse_creation_output(results)
@property_hash = { @property_hash = {
:ensure => :present, :ensure => :present,
@ -186,9 +185,6 @@ Puppet::Type.type(:neutron_subnet).provide(
:network_id => attrs['network_id'], :network_id => attrs['network_id'],
:tenant_id => attrs['tenant_id'], :tenant_id => attrs['tenant_id'],
} }
else
fail("did not get expected message on subnet creation, got #{results}")
end
end end
def destroy def destroy