mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Further Linting to quiet the linter
This commit is contained in:
parent
7eff8ad070
commit
4aec37397c
1 changed files with 12 additions and 16 deletions
|
@ -1442,8 +1442,8 @@ def build(path=None,
|
|||
|
||||
except Exception:
|
||||
_invalid(status,
|
||||
out=traceback.format_exc(),
|
||||
comment='Unexpected error while building an image')
|
||||
out=traceback.format_exc(),
|
||||
comment='Unexpected error while building an image')
|
||||
return status
|
||||
|
||||
return status
|
||||
|
@ -1821,11 +1821,11 @@ def _run_wrapper(status, container, func, cmd, *args, **kwargs):
|
|||
ret = f(full_cmd, *args, **kwargs)
|
||||
if ((isinstance(ret, dict) and ('retcode' in ret) and (ret['retcode'] != 0))
|
||||
or (func == 'cmd.retcode' and ret != 0)):
|
||||
_invalid(status, id_=container, out=ret,comment=comment)
|
||||
_invalid(status, id_=container, out=ret, comment=comment)
|
||||
else:
|
||||
_valid(status, id_=container, out=ret, comment=comment)
|
||||
except Exception:
|
||||
_invalid(status, id_=container,comment=comment, out=traceback.format_exc())
|
||||
_invalid(status, id_=container, comment=comment, out=traceback.format_exc())
|
||||
return status
|
||||
|
||||
|
||||
|
@ -1850,9 +1850,7 @@ def load(imagepath):
|
|||
try:
|
||||
dockercmd = ['docker', 'load', '-i', imagepath]
|
||||
ret = __salt__['cmd.run'](dockercmd, python_shell=False)
|
||||
if ((isinstance(ret, dict) and
|
||||
('retcode' in ret) and
|
||||
(ret['retcode'] != 0))):
|
||||
if ((isinstance(ret, dict) and ('retcode' in ret) and (ret['retcode'] != 0))):
|
||||
return _invalid(status, id_=None,
|
||||
out=ret,
|
||||
comment='Command to load image {0} failed.'.format(imagepath))
|
||||
|
@ -1860,12 +1858,12 @@ def load(imagepath):
|
|||
_valid(status, id_=None, out=ret, comment='Image load success')
|
||||
except Exception:
|
||||
_invalid(status, id_=None,
|
||||
comment="Image not loaded.",
|
||||
out=traceback.format_exc())
|
||||
comment="Image not loaded.",
|
||||
out=traceback.format_exc())
|
||||
else:
|
||||
_invalid(status, id_=None,
|
||||
comment='Image file {0} could not be found.'.format(imagepath),
|
||||
out=traceback.format_exc())
|
||||
comment='Image file {0} could not be found.'.format(imagepath),
|
||||
out=traceback.format_exc())
|
||||
|
||||
return status
|
||||
|
||||
|
@ -1896,16 +1894,14 @@ def save(image, filename):
|
|||
ok = True
|
||||
except Exception:
|
||||
_invalid(status, id_=image,
|
||||
comment="docker image {0} could not be found.".format(image),
|
||||
out=traceback.format_exc())
|
||||
comment="docker image {0} could not be found.".format(image),
|
||||
out=traceback.format_exc())
|
||||
|
||||
if ok:
|
||||
try:
|
||||
dockercmd = ['docker', 'save', '-o', filename, image]
|
||||
ret = __salt__['cmd.run'](dockercmd)
|
||||
if ((isinstance(ret, dict) and
|
||||
('retcode' in ret) and
|
||||
(ret['retcode'] != 0))):
|
||||
if ((isinstance(ret, dict) and ('retcode' in ret) and (ret['retcode'] != 0))):
|
||||
return _invalid(status,
|
||||
id_=image,
|
||||
out=ret,
|
||||
|
|
Loading…
Add table
Reference in a new issue