mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-03-22 02:29:08 +00:00
Convert str to json format before evaluating length. (#574)
Signed-off-by: nishipy <goodisonev4@gmail.com>
This commit is contained in:
parent
4149dece62
commit
e8c270370d
1 changed files with 4 additions and 2 deletions
|
|
@ -524,8 +524,9 @@ class PodmanImageManager(object):
|
|||
image_name = self.image_name
|
||||
args = ['image', 'ls', image_name, '--format', 'json']
|
||||
rc, images, err = self._run(args, ignore_errors=True)
|
||||
images = json.loads(images)
|
||||
if len(images) > 0:
|
||||
return json.loads(images)
|
||||
return images
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
@ -547,8 +548,9 @@ class PodmanImageManager(object):
|
|||
image_name = self.image_name
|
||||
args = ['inspect', image_name, '--format', 'json']
|
||||
rc, image_data, err = self._run(args)
|
||||
image_data = json.loads(image_data)
|
||||
if len(image_data) > 0:
|
||||
return json.loads(image_data)
|
||||
return image_data
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue