summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2/server.py
diff options
context:
space:
mode:
authorCedric Brandily <zzelle@gmail.com>2016-09-16 22:00:23 +0200
committerCedric Brandily <zzelle@gmail.com>2017-03-20 22:33:51 +0100
commitf5527877bb6dab09757b6692460bcc376b7d5ec3 (patch)
tree6a8b1421092b70932cd5105c27c66b6356e65f4e /openstackclient/compute/v2/server.py
parent98d5641ac5b99dc47cd72941b71303547f9e6054 (diff)
downloadpython-openstackclient-f5527877bb6dab09757b6692460bcc376b7d5ec3.tar.gz
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 <vm> <fip> --fixed-ip-address <ip> Closes-Bug: #1624524 Change-Id: I2ddb68c5873bfed7293b0e661d1adbe111681136
Diffstat (limited to 'openstackclient/compute/v2/server.py')
-rw-r--r--openstackclient/compute/v2/server.py9
1 files changed, 8 insertions, 1 deletions
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="<fixed-ip-address>",
+ 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):