Merge "Trivial: Import network.common as network_common in server.py"

This commit is contained in:
Jenkins 2015-12-05 23:24:18 +00:00 committed by Gerrit Code Review
commit 0cafffa4b2

View File

@ -37,7 +37,7 @@ from openstackclient.common import parseractions
from openstackclient.common import utils
from openstackclient.i18n import _ # noqa
from openstackclient.identity import common as identity_common
from openstackclient.network import common
from openstackclient.network import common as network_common
def _format_servers_list_networks(networks):
@ -476,15 +476,19 @@ class CreateServer(show.ShowOne):
if neutron_enabled:
network_client = self.app.client_manager.network
if nic_info["net-id"]:
nic_info["net-id"] = common.find(network_client,
nic_info["net-id"] = network_common.find(
network_client,
'network',
'networks',
nic_info["net-id"])
nic_info["net-id"]
)
if nic_info["port-id"]:
nic_info["port-id"] = common.find(network_client,
nic_info["port-id"] = network_common.find(
network_client,
'port',
'ports',
nic_info["port-id"])
nic_info["port-id"]
)
else:
if nic_info["net-id"]:
nic_info["net-id"] = utils.find_resource(