runner: implement container_exist
On podman, we can run "podman container exists" command to check if whether or not a container does exist. This will be used later when we'll reduce our usage of "podman inspect". Change-Id: I6dfbfe9da3d216cadaca77a53a0d5223c9cbd57d
This commit is contained in:
		@@ -273,6 +273,11 @@ class DockerRunner(BaseRunner):
 | 
			
		||||
                         "by %s" % self.cont_cmd)
 | 
			
		||||
        return True
 | 
			
		||||
 | 
			
		||||
    def container_exist(self, name, quiet=False):
 | 
			
		||||
        self.log.warning("container_exist isn't supported "
 | 
			
		||||
                         "by %s" % self.cont_cmd)
 | 
			
		||||
        return True
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PodmanRunner(BaseRunner):
 | 
			
		||||
 | 
			
		||||
@@ -342,3 +347,8 @@ class PodmanRunner(BaseRunner):
 | 
			
		||||
        cmd = ['podman', 'image', 'exists', name]
 | 
			
		||||
        (_, _, returncode) = self.execute(cmd, self.log, quiet)
 | 
			
		||||
        return returncode == 0
 | 
			
		||||
 | 
			
		||||
    def container_exist(self, name, quiet=False):
 | 
			
		||||
        cmd = ['podman', 'container', 'exists', name]
 | 
			
		||||
        (_, _, returncode) = self.execute(cmd, self.log, quiet)
 | 
			
		||||
        return returncode == 0
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user