Change neutron module use same call neutron client
The call of self.list_networks is a shortcut of self.neutron.list_networks because this class override the __getattr__ method which will invoke unknown method from self.neutron. This patch switches to the shortcut version to follow the code convention to reduce confusion of our contributors. Change-Id: I05b003d0e7d993873d8690694ddc41f07ecbf7d8 Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
This commit is contained in:
parent
a7471e757c
commit
b88addc57c
|
@ -46,9 +46,9 @@ class NeutronAPI(object):
|
||||||
|
|
||||||
def get_neutron_network(self, network):
|
def get_neutron_network(self, network):
|
||||||
if uuidutils.is_uuid_like(network):
|
if uuidutils.is_uuid_like(network):
|
||||||
networks = self.neutron.list_networks(id=network)['networks']
|
networks = self.list_networks(id=network)['networks']
|
||||||
else:
|
else:
|
||||||
networks = self.neutron.list_networks(name=network)['networks']
|
networks = self.list_networks(name=network)['networks']
|
||||||
|
|
||||||
if len(networks) == 0:
|
if len(networks) == 0:
|
||||||
raise exception.NetworkNotFound(network=network)
|
raise exception.NetworkNotFound(network=network)
|
||||||
|
|
Loading…
Reference in New Issue