diff --git a/magnumclient/tests/v1/test_containers.py b/magnumclient/tests/v1/test_containers.py index f70f217f..b7ad3d83 100644 --- a/magnumclient/tests/v1/test_containers.py +++ b/magnumclient/tests/v1/test_containers.py @@ -26,14 +26,14 @@ CONTAINER1 = {'id': 123, 'uuid': '66666666-7777-8888-9999-000000000001', 'bay_uuid': '25d5d872-1f4e-4134-ae15-c5fa38cb09a3', 'name': 'container1', - 'image_id': 'c-image1', + 'image': 'c-image1', 'command': 'c-command1', } CONTAINER2 = {'id': 124, 'uuid': '66666666-7777-8888-9999-000000000002', 'bay_uuid': '25d5d872-1f4e-4134-ae15-c5fa38cb09a3', 'name': 'container1', - 'image_id': 'c-image2', + 'image': 'c-image2', 'command': 'c-command2', } @@ -210,7 +210,7 @@ class ContainerManagerTest(testtools.TestCase): ] self.assertEqual(expect, self.api.calls) self.assertEqual(CONTAINER1['name'], container.name) - self.assertEqual(CONTAINER1['image_id'], container.image_id) + self.assertEqual(CONTAINER1['image'], container.image) def test_container_create(self): container = self.mgr.create(**CREATE_CONTAINER) diff --git a/magnumclient/tests/v1/test_shell.py b/magnumclient/tests/v1/test_shell.py index 0d94159f..59f06bd4 100644 --- a/magnumclient/tests/v1/test_shell.py +++ b/magnumclient/tests/v1/test_shell.py @@ -452,8 +452,8 @@ class ShellTest(base.TestCase): args = mock.MagicMock() name = "containe1" args.name = name - image_id = "test_image_id" - args.image_id = image_id + image = "test_image" + args.image = image bay_id_or_name = "xxx" args.bay_id = bay_id_or_name command = "test_command" @@ -461,7 +461,7 @@ class ShellTest(base.TestCase): shell.do_container_create(client_mock, args) client_mock.containers.create.assert_called_once_with( - name=name, image_id=image_id, bay_uuid=bay.uuid, command=command) + name=name, image=image, bay_uuid=bay.uuid, command=command) def test_do_container_list(self): client_mock = mock.MagicMock() diff --git a/magnumclient/v1/containers.py b/magnumclient/v1/containers.py index 53cfe913..73526590 100644 --- a/magnumclient/v1/containers.py +++ b/magnumclient/v1/containers.py @@ -19,7 +19,7 @@ from magnumclient.common import utils from magnumclient import exceptions -CREATION_ATTRIBUTES = ['name', 'image_id', 'command', 'bay_uuid'] +CREATION_ATTRIBUTES = ['name', 'image', 'command', 'bay_uuid'] class Container(base.Resource): diff --git a/magnumclient/v1/shell.py b/magnumclient/v1/shell.py index 1ede4ebd..06b1a16c 100644 --- a/magnumclient/v1/shell.py +++ b/magnumclient/v1/shell.py @@ -530,9 +530,9 @@ def do_service_show(cs, args): @utils.arg('--name', metavar='', help='name of the container') -@utils.arg('--image_id', - metavar='', - help='ID of the image') +@utils.arg('--image', + metavar='', + help='name or ID of the image') @utils.arg('--bay', required=True, metavar='', @@ -550,7 +550,7 @@ def do_container_create(cs, args): return opts = {} opts['name'] = args.name - opts['image_id'] = args.image_id + opts['image'] = args.image opts['bay_uuid'] = bay.uuid opts['command'] = args.command _show_container(cs.containers.create(**opts))