summaryrefslogtreecommitdiff
path: root/novaclient/shell.py
diff options
context:
space:
mode:
authorAndrey Kurilin <akurilin@mirantis.com>2016-04-21 12:00:04 +0300
committerAndrey Kurilin <akurilin@mirantis.com>2016-06-16 05:57:59 +0000
commitf9bdba2dd707ee77ffdc67869c5517078a26a014 (patch)
treeac22fe8daac9b4f4289d72e6a2a89a44ce9bf7a9 /novaclient/shell.py
parent19ff19e1b8e632e03aff50621d200a258b2014b2 (diff)
downloadpython-novaclient-f9bdba2dd707ee77ffdc67869c5517078a26a014.tar.gz
Extend microversion stuff to support resource classes
Current implementation of novaclient.api_versions.wraps allow to use versioned methods for shell functions and resource managers. As resource managers can have versioned methods, resource objects can have it too, but it was not implemented yet. This patch fixes this omission. Changes: - Add api_version property to base resource class. It is mapped to api_version property of manager class; - Move `novaclient.utils.generate_function_name` to `novaclient.api_versions._generate_function_name`, since this method is specific to microversion stuff and should not used outside api_versions module; - Rewrite _generate_function_name to handle class(owner) name. Previously, it was improssible to have two classes in one module with versioned methods with equal names. - Remove call of generate_function_name from novaclient.shell. Shell module should not take care about function identifiers. get_substitutions accepts object with __id__ property now. - Mark _add_substitution as private method, since it should not be used outside api_versions module - Split all versioned methods of Server resource from novaclient.v2.servers module. Change-Id: Icfce16bfa6f919d7f8451d592f4a8e276b1f1709
Diffstat (limited to 'novaclient/shell.py')
-rw-r--r--novaclient/shell.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/novaclient/shell.py b/novaclient/shell.py
index a8b5c0a4..bbfe959d 100644
--- a/novaclient/shell.py
+++ b/novaclient/shell.py
@@ -633,8 +633,7 @@ class OpenStackComputeShell(object):
desc = callback.__doc__ or ''
if hasattr(callback, "versioned"):
additional_msg = ""
- subs = api_versions.get_substitutions(
- utils.get_function_name(callback))
+ subs = api_versions.get_substitutions(callback)
if do_help:
additional_msg = msg % {
'start': subs[0].start_version.get_string(),