From 2cae5ac9c45eeecb496ef06d5d44ae8deec144b7 Mon Sep 17 00:00:00 2001 From: liguomin Date: Mon, 23 Jan 2017 15:20:36 +0800 Subject: ESCALATOR-42 Get available version list Change-Id: Ib1d0743b752ac81587ea6f8b7830b79abe09f8f0 Signed-off-by: liguomin --- client/escalatorclient/v1/shell.py | 2 +- client/escalatorclient/v1/versions.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'client/escalatorclient/v1') diff --git a/client/escalatorclient/v1/shell.py b/client/escalatorclient/v1/shell.py index f926a8a..fbc2459 100644 --- a/client/escalatorclient/v1/shell.py +++ b/client/escalatorclient/v1/shell.py @@ -149,7 +149,7 @@ def do_version_delete(dc, args): @utils.arg('--sort-dir', default='asc', choices=escalatorclient.v1.versions.SORT_DIR_VALUES, help='Sort version list in specified direction.') -def do_version_list(dc, args): +def do_cluster_version_list(dc, args): """List hosts you can access.""" filter_keys = ['name', 'type', 'status', 'version'] filter_items = [(key, getattr(args, key)) for key in filter_keys] diff --git a/client/escalatorclient/v1/versions.py b/client/escalatorclient/v1/versions.py index f54ea23..f98a3ed 100644 --- a/client/escalatorclient/v1/versions.py +++ b/client/escalatorclient/v1/versions.py @@ -22,6 +22,7 @@ import six.moves.urllib.parse as urlparse from escalatorclient.common import utils from escalatorclient.openstack.common.apiclient import base +from escalatorclient.common.http import HTTPClient CREATE_PARAMS = ('id', 'name', 'description', 'type', 'version', 'size', 'checksum', 'status', 'os_status', 'version_patch') @@ -53,8 +54,14 @@ class Version(base.Resource): class VersionManager(base.ManagerWithFind): resource_class = Version + def get_version_client(self): + endpoint = "http://127.0.0.1:19292" + client = HTTPClient(endpoint) + return client + def _list(self, url, response_key, obj_class=None, body=None): - resp, body = self.client.get(url) + version_client = self.get_version_client() + resp, body = version_client.get(url) if obj_class is None: obj_class = self.resource_class -- cgit 1.2.3-korg