From f5527877bb6dab09757b6692460bcc376b7d5ec3 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Fri, 16 Sep 2016 22:00:23 +0200 Subject: Enable to specify which vm fixed-ip to publish This change enables to specify which vm fixed-ip will be associated to a floating ip using: openstack server add floating ip --fixed-ip-address Closes-Bug: #1624524 Change-Id: I2ddb68c5873bfed7293b0e661d1adbe111681136 --- openstackclient/compute/v2/server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'openstackclient/compute') diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index d33c631a..3cffa0a9 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -235,6 +235,12 @@ class AddFloatingIP(command.Command): help=_("Floating IP address (IP address only) to assign " "to server"), ) + parser.add_argument( + "--fixed-ip-address", + metavar="", + help=_("Fixed IP address to associate with this floating IP " + "address"), + ) return parser def take_action(self, parsed_args): @@ -243,7 +249,8 @@ class AddFloatingIP(command.Command): server = utils.find_resource( compute_client.servers, parsed_args.server) - server.add_floating_ip(parsed_args.ip_address) + server.add_floating_ip(parsed_args.ip_address, + parsed_args.fixed_ip_address) class AddServerSecurityGroup(command.Command): -- cgit v1.2.1