Add member-get command

It is observed that python-glanceclient was missing support for GET /v2/image/{image_id}/member/{member_id} API.
This patch adds new command `member-get` to support this missing operation.

Closes-Bug: #1938154

Change-Id: I3709f6a39535aa45bee70f468f015ac60a1375a8
This commit is contained in:
Mridula Joshi
2021-07-29 12:25:37 +00:00
parent 158d5f4248
commit cb084f5289
5 changed files with 46 additions and 1 deletions
@@ -2378,6 +2378,16 @@ class ShellV2Test(testtools.TestCase):
columns = ['Image ID', 'Member ID', 'Status']
utils.print_list.assert_called_once_with({}, columns)
def test_do_member_get(self):
args = self._make_args({'image_id': 'IMG-01', 'member_id': 'MEM-01'})
with mock.patch.object(self.gc.image_members, 'get') as mock_get:
mock_get.return_value = {}
test_shell.do_member_get(self.gc, args)
mock_get.assert_called_once_with('IMG-01', 'MEM-01')
utils.print_dict.assert_called_once_with({})
def test_do_member_create(self):
args = self._make_args({'image_id': 'IMG-01', 'member_id': 'MEM-01'})
with mock.patch.object(self.gc.image_members, 'create') as mock_create: