summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2/host.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2018-03-05 14:18:41 -0600
committerDean Troyer <dtroyer@gmail.com>2018-03-13 09:10:45 -0500
commit53e7aab7ed4d6c981ca067c1db8bce290a5f0055 (patch)
tree24f5bac6fd11336367170de84bbfcaff8b9ce8bf /openstackclient/compute/v2/host.py
parentb10941ddf6f7f6894b7d87f25c173f227b111e4e (diff)
downloadpython-openstackclient-53e7aab7ed4d6c981ca067c1db8bce290a5f0055.tar.gz
Re-implement novaclient bits removed in 10.0
a) /os-floating-ips was removed in Compute API 2.36 and from novaclient's Python API in 10.0 Add to api.computev2: floating_ip_add() floating_ip_remove() Convert add floating IP command to nova-net/neutron split: "server add floating ip" "server remove floating ip" b) /os-hosts was removed in Compute API 2.43 and from novaclient's Python API in 10.0. Add to api.computev2: host_list() host_set() host_show() Convert host commands to use intenal api: "host list" "host set" "host show" c) The introduction of the Network-style commands into the server group broke cliff's autoprogram directive as it executes the get_parser() methods without fully initializing the Command object. NOTE: This is really three reviews squashed to get through the gate in one pass. Depends-on: Id6de87211d6c4ea8fd14aa9203d8d5b17e9e2f04 Change-Id: I5116086f9a9e4b2b31a744bf8f4558c79f0bfe59
Diffstat (limited to 'openstackclient/compute/v2/host.py')
-rw-r--r--openstackclient/compute/v2/host.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/openstackclient/compute/v2/host.py b/openstackclient/compute/v2/host.py
index a495b367..9fdfd927 100644
--- a/openstackclient/compute/v2/host.py
+++ b/openstackclient/compute/v2/host.py
@@ -40,9 +40,9 @@ class ListHost(command.Lister):
"Service",
"Zone"
)
- data = compute_client.hosts.list_all(parsed_args.zone)
+ data = compute_client.api.host_list(parsed_args.zone)
return (columns,
- (utils.get_item_properties(
+ (utils.get_dict_properties(
s, columns,
) for s in data))
@@ -95,13 +95,7 @@ class SetHost(command.Command):
compute_client = self.app.client_manager.compute
- # More than one hosts will be returned by using find_resource()
- # so that the return value cannot be used in host update() method.
- # find_resource() is just used for checking existence of host and
- # keeping the exception message consistent with other commands.
- utils.find_resource(compute_client.hosts, parsed_args.host)
-
- compute_client.hosts.update(
+ compute_client.api.host_set(
parsed_args.host,
kwargs
)
@@ -128,8 +122,10 @@ class ShowHost(command.Lister):
"Memory MB",
"Disk GB"
)
- data = compute_client.hosts.get(parsed_args.host)
+
+ data = compute_client.api.host_show(parsed_args.host)
+
return (columns,
- (utils.get_item_properties(
+ (utils.get_dict_properties(
s, columns,
) for s in data))