Fix server create with nova-net
A Neutron-ism slipped by in server create. Change-Id: Id590d7f93df2a41d7bd7617459a2af159a6f8071
This commit is contained in:
parent
0a0bcbbda2
commit
bffc98e4e5
@ -655,10 +655,9 @@ class CreateServer(command.ShowOne):
|
|||||||
nic_info["port-id"] = port.id
|
nic_info["port-id"] = port.id
|
||||||
else:
|
else:
|
||||||
if nic_info["net-id"]:
|
if nic_info["net-id"]:
|
||||||
nic_info["net-id"] = utils.find_resource(
|
nic_info["net-id"] = compute_client.api.network_find(
|
||||||
compute_client.networks,
|
|
||||||
nic_info["net-id"]
|
nic_info["net-id"]
|
||||||
).id
|
)['id']
|
||||||
if nic_info["port-id"]:
|
if nic_info["port-id"]:
|
||||||
msg = _("can't create server with port specified "
|
msg = _("can't create server with port specified "
|
||||||
"since network endpoint not enabled")
|
"since network endpoint not enabled")
|
||||||
|
@ -207,12 +207,20 @@ class ServerTests(common.ComputeTestCase):
|
|||||||
'floating ip create -f json ' +
|
'floating ip create -f json ' +
|
||||||
'public'
|
'public'
|
||||||
))
|
))
|
||||||
floating_ip = cmd_output['floating_ip_address']
|
|
||||||
|
# Look for Neutron value first, then nova-net
|
||||||
|
floating_ip = cmd_output.get(
|
||||||
|
'floating_ip_address',
|
||||||
|
cmd_output.get(
|
||||||
|
'ip',
|
||||||
|
None,
|
||||||
|
),
|
||||||
|
)
|
||||||
self.assertNotEqual('', cmd_output['id'])
|
self.assertNotEqual('', cmd_output['id'])
|
||||||
self.assertNotEqual('', floating_ip)
|
self.assertNotEqual('', floating_ip)
|
||||||
self.addCleanup(
|
self.addCleanup(
|
||||||
self.openstack,
|
self.openstack,
|
||||||
'floating ip delete ' + cmd_output['id']
|
'floating ip delete ' + str(cmd_output['id'])
|
||||||
)
|
)
|
||||||
|
|
||||||
raw_output = self.openstack(
|
raw_output = self.openstack(
|
||||||
|
Loading…
Reference in New Issue
Block a user