Rename router to network
Floating IPs will be created in the external netork. Thus, you'll need to specify the name of the network, not the name of the router. Change-Id: Ia626832187015282e4f6dd3d3066a1612ccb62e8
This commit is contained in:
parent
b1906a0c8c
commit
d2e636c94d
|
@ -158,15 +158,15 @@ class Novautils(object):
|
|||
+ "Won't create test floating ip. "
|
||||
+ "Please check and delete.")
|
||||
|
||||
def get_network_id(self, router_name):
|
||||
def get_network_id(self, ext_network_name):
|
||||
if not self.msgs:
|
||||
if not self.network_id:
|
||||
try:
|
||||
self.network_id = self.nova_client.list_networks(
|
||||
name=router_name, fields='id')['networks'][0]['id']
|
||||
name=ext_network_name, fields='id')['networks'][0]['id']
|
||||
except Exception:
|
||||
self.msgs.append("Cannot find ext router named '%s'."
|
||||
% router_name)
|
||||
self.msgs.append("Cannot find ext network named '%s'."
|
||||
% ext_network_name)
|
||||
|
||||
def create_floating_ip(self):
|
||||
if not self.msgs:
|
||||
|
@ -243,9 +243,9 @@ def _check_neutron_floating_ip():
|
|||
+ 'ip to be kept. Its default value prevents the '
|
||||
+ 'removal of any existing floating ip')
|
||||
|
||||
parser.add_argument('--ext_router_name', metavar='ext_router_name',
|
||||
parser.add_argument('--ext_network_name', metavar='ext_network_name',
|
||||
type=str, default='public',
|
||||
help='Name of the "public" router (public by default)')
|
||||
help='Name of the "public" external network (public by default)')
|
||||
|
||||
parser.add_argument('--verbose', action='count',
|
||||
help='Print requests on stderr.')
|
||||
|
@ -286,7 +286,7 @@ def _check_neutron_floating_ip():
|
|||
|
||||
if args.floating_ip:
|
||||
util.check_existing_floatingip(args.floating_ip, args.force_delete)
|
||||
util.get_network_id(args.ext_router_name)
|
||||
util.get_network_id(args.ext_network_name)
|
||||
util.create_floating_ip()
|
||||
util.delete_floating_ip()
|
||||
|
||||
|
|
Loading…
Reference in New Issue