diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py index 80fd0feab..e9be52897 100644 --- a/cinderclient/tests/unit/v3/test_shell.py +++ b/cinderclient/tests/unit/v3/test_shell.py @@ -95,11 +95,11 @@ class ShellTest(utils.TestCase): self.run_command('availability-zone-list') self.assert_called('GET', '/os-availability-zone') - @ddt.data({'cmd': '1234 --instance 1233', + @ddt.data({'cmd': '1234 1233', 'body': {'instance_uuid': '1233', 'connector': {}, 'volume_uuid': '1234'}}, - {'cmd': '1234 --instance 1233 ' + {'cmd': '1234 1233 ' '--connect True ' '--ip 10.23.12.23 --host server01 ' '--platform x86_xx ' diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py index 1e8c15643..e950f7c75 100644 --- a/cinderclient/v3/shell.py +++ b/cinderclient/v3/shell.py @@ -1355,7 +1355,7 @@ def do_attachment_list(cs, args): marker=args.marker, limit=args.limit, sort=args.sort) - columns = ['ID', 'Volume ID', 'Status', 'Instance'] + columns = ['ID', 'Volume ID', 'Status', 'Server ID'] if args.sort: sortby_index = None else: @@ -1385,10 +1385,9 @@ def do_attachment_show(cs, args): @utils.arg('volume', metavar='', help='Name or ID of volume or volumes to attach.') -@utils.arg('--instance', - metavar='', - default=None, - help='UUID of Instance attaching to. Default=None.') +@utils.arg('server_id', + metavar='', + help='ID of server attaching to.') @utils.arg('--connect', metavar='', default=False, @@ -1437,7 +1436,7 @@ def do_attachment_create(cs, args): 'mountpoint': args.mountpoint} attachment = cs.attachments.create(args.volume, connector, - args.instance) + args.server_id) connector_dict = attachment.pop('connection_info', None) utils.print_dict(attachment) if connector_dict: diff --git a/releasenotes/notes/bug-1675975-ad91a7a34e0esywc.yaml b/releasenotes/notes/bug-1675975-ad91a7a34e0esywc.yaml new file mode 100644 index 000000000..71f1cff6e --- /dev/null +++ b/releasenotes/notes/bug-1675975-ad91a7a34e0esywc.yaml @@ -0,0 +1,6 @@ +--- +fixes: +- The 'server_id' is now a required parameter when creating an + attachment, that means we should create an attachment with + a command like, 'cinder attachment-create '. + [Bug `1675975 `_]