Ansible: Remove vpp_device snergster dependency 35/31735/2
authorpmikus <pmikus@cisco.com>
Mon, 16 Nov 2020 08:15:17 +0000 (08:15 +0000)
committerPeter Mikus <pmikus@cisco.com>
Mon, 29 Mar 2021 13:15:25 +0000 (13:15 +0000)
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: I145a4b5511141f1e2b4e387daa358e32dd2c8015
(cherry picked from commit 54fa83f3c0c962aa3c5b4e2e803476874a40e80e)

resources/libraries/python/ContainerUtils.py

index 71bb1d7..2810623 100644 (file)
@@ -1000,13 +1000,13 @@ class Docker(ContainerEngine):
                 else Constants.DOCKER_SUT_IMAGE_UBUNTU
             setattr(self.container, u"image", img)
 
-        cmd = f"docker pull {self.container.image}"
-
-        ret, _, _ = self.container.ssh.exec_command_sudo(cmd, timeout=1800)
-        if int(ret) != 0:
-            raise RuntimeError(
-                f"Failed to create container {self.container.name}."
-            )
+        if "/" in self.container.image:
+            cmd = f"docker pull {self.container.image}"
+            ret, _, _ = self.container.ssh.exec_command_sudo(cmd, timeout=1800)
+            if int(ret) != 0:
+                raise RuntimeError(
+                    f"Failed to create container {self.container.name}."
+                )
 
         if self.container.cpuset_cpus:
             self._configure_cgroup(u"docker")