summaryrefslogtreecommitdiff
path: root/novaclient/v2
diff options
context:
space:
mode:
authorTakashi Natsume <takanattie@gmail.com>2021-01-03 23:06:46 +0900
committerTakashi Natsume <takanattie@gmail.com>2021-01-13 14:43:51 +0000
commit9b474afdb2e15d058babe82e50efe6c93c2e94a2 (patch)
tree1744e5d42c11208d95021ecc6ee5c56f8f344f90 /novaclient/v2
parente85d845b1aa5a18537907ba561a2718db2ccbed8 (diff)
downloadpython-novaclient-9b474afdb2e15d058babe82e50efe6c93c2e94a2.tar.gz
Deprecate agent commands and APIs17.3.0
The os-agents APIs have been removed by the following change. I9512f605dd2b3b0e88c951ed086250d57056303d This patch makes commands related to the APIs deprecated in accordance with the following policy. * https://docs.openstack.org/python-novaclient/latest/contributor/deprecation-policy.html The API bindings related to the APIs remains as they are because python-openstackclient depends on the API bindings. Change-Id: I89d7877e23e8802fe77987a7b24ea247e08d5218 Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Diffstat (limited to 'novaclient/v2')
-rw-r--r--novaclient/v2/agents.py5
-rw-r--r--novaclient/v2/shell.py20
2 files changed, 21 insertions, 4 deletions
diff --git a/novaclient/v2/agents.py b/novaclient/v2/agents.py
index 0a6c223e..d71bf194 100644
--- a/novaclient/v2/agents.py
+++ b/novaclient/v2/agents.py
@@ -19,6 +19,11 @@ agent interface
from novaclient import base
+# NOTE(takashin): The os-agents APIs have been removed
+# in https://review.opendev.org/c/openstack/nova/+/749309 .
+# But the following API bindings remains as ther are
+# because the python-openstackclient depends on them.
+
class Agent(base.Resource):
def __repr__(self):
diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py
index 753dd127..23f5486f 100644
--- a/novaclient/v2/shell.py
+++ b/novaclient/v2/shell.py
@@ -55,6 +55,14 @@ def emit_duplicated_image_with_warning(img, image_with):
file=sys.stderr)
+# TODO(takashin): Remove this along with the deprecated commands in the first
+# major python-novaclient release AFTER the nova server 24.0.0 X release.
+def _emit_agent_deprecation_warning():
+ print('This command has been deprecated since 23.0.0 Wallaby Release '
+ 'and will be removed in the first major release '
+ 'after the Nova server 24.0.0 X release.', file=sys.stderr)
+
+
CLIENT_BDM2_KEYS = {
'id': 'uuid',
'source': 'source_type',
@@ -3411,7 +3419,8 @@ def do_usage(cs, args):
default=None,
help=_('Type of hypervisor.'))
def do_agent_list(cs, args):
- """List all builds."""
+ """DEPRECATED List all builds."""
+ _emit_agent_deprecation_warning()
result = cs.agents.list(args.hypervisor)
columns = ["Agent_id", "Hypervisor", "OS", "Architecture", "Version",
'Md5hash', 'Url']
@@ -3432,7 +3441,8 @@ def do_agent_list(cs, args):
default='xen',
help=_('Type of hypervisor.'))
def do_agent_create(cs, args):
- """Create new agent build."""
+ """DEPRECATED Create new agent build."""
+ _emit_agent_deprecation_warning()
result = cs.agents.create(args.os, args.architecture,
args.version, args.url,
args.md5hash, args.hypervisor)
@@ -3441,7 +3451,8 @@ def do_agent_create(cs, args):
@utils.arg('id', metavar='<id>', help=_('ID of the agent-build.'))
def do_agent_delete(cs, args):
- """Delete existing agent build."""
+ """DEPRECATED Delete existing agent build."""
+ _emit_agent_deprecation_warning()
cs.agents.delete(args.id)
@@ -3450,7 +3461,8 @@ def do_agent_delete(cs, args):
@utils.arg('url', metavar='<url>', help=_('URL'))
@utils.arg('md5hash', metavar='<md5hash>', help=_('MD5 hash.'))
def do_agent_modify(cs, args):
- """Modify existing agent build."""
+ """DEPRECATED Modify existing agent build."""
+ _emit_agent_deprecation_warning()
result = cs.agents.update(args.id, args.version,
args.url, args.md5hash)
utils.print_dict(result.to_dict())