浏览代码

Display containers name when scale a container

Display in the log output the name of those containers created using the scale command and
change the test_scale_with_api_error test to support the containers name when scale

Signed-off-by: Jesus Rodriguez Tinoco <[email protected]>
Jesus 9 年之前
父节点
当前提交
6bfb23baaa
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      compose/service.py
  2. 1 1
      tests/integration/service_test.py

+ 1 - 1
compose/service.py

@@ -223,7 +223,7 @@ class Service(object):
             parallel_execute(
                 container_numbers,
                 lambda n: create_and_start(service=self, number=n),
-                lambda n: n,
+                lambda n: self.get_container_name(n),
                 "Creating and starting"
             )
 

+ 1 - 1
tests/integration/service_test.py

@@ -735,7 +735,7 @@ class ServiceTest(DockerClientTestCase):
 
         self.assertEqual(len(service.containers()), 1)
         self.assertTrue(service.containers()[0].is_running)
-        self.assertIn("ERROR: for 2  Boom", mock_stderr.getvalue())
+        self.assertIn("ERROR: for composetest_web_2  Boom", mock_stderr.getvalue())
 
     def test_scale_with_unexpected_exception(self):
         """Test that when scaling if the API returns an error, that is not of type