Merge "Fix "device" as the optional para on volume-attach"

This commit is contained in:
Jenkins 2013-12-25 01:59:24 +00:00 committed by Gerrit Code Review
commit 708af32f03
3 changed files with 9 additions and 2 deletions

View File

@ -1790,6 +1790,13 @@ class ShellTest(utils.TestCase):
{'device': '/dev/vdb',
'volumeId': 'Work'}})
def test_volume_attach_without_device(self):
self.run_command('volume-attach sample-server Work')
self.assert_called('POST', '/servers/1234/os-volume_attachments',
{'volumeAttachment':
{'device': None,
'volumeId': 'Work'}})
def test_volume_update(self):
self.run_command('volume-update sample-server Work Work')
self.assert_called('PUT', '/servers/1234/os-volume_attachments/Work',

View File

@ -1706,7 +1706,7 @@ def do_volume_delete(cs, args):
@utils.arg('volume',
metavar='<volume>',
help='ID of the volume to attach.')
@utils.arg('device', metavar='<device>',
@utils.arg('device', metavar='<device>', default=None, nargs='?',
help='Name of the device e.g. /dev/vdb. '
'Use "auto" for autoassign (if supported)')
def do_volume_attach(cs, args):

View File

@ -1535,7 +1535,7 @@ def do_volume_delete(cs, args):
@utils.arg('volume',
metavar='<volume>',
help='ID of the volume to attach.')
@utils.arg('device', metavar='<device>',
@utils.arg('device', metavar='<device>', default=None, nargs='?',
help='Name of the device e.g. /dev/vdb. '
'Use "auto" for autoassign (if supported)')
def do_volume_attach(cs, args):