mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Some fixes and pylint
This commit is contained in:
parent
1e6ba45db4
commit
ef26e93bb7
2 changed files with 3 additions and 8 deletions
|
@ -550,7 +550,6 @@ def undo(config='root', files=None, num_pre=None, num_post=None):
|
|||
'Given file list contains files that are not present'
|
||||
'in the changed filelist: {0}'.format(changed - requested))
|
||||
|
||||
|
||||
cmdret = __salt__['cmd.run']('snapper -c {0} undochange {1}..{2} {3}'.format(
|
||||
config, pre, post, ' '.join(requested)))
|
||||
|
||||
|
@ -563,7 +562,7 @@ def undo(config='root', files=None, num_pre=None, num_post=None):
|
|||
return ret
|
||||
except ValueError as exc:
|
||||
raise CommandExecutionError(
|
||||
'Error while processing Snapper response: {}'.format(cmdret))
|
||||
'Error while processing Snapper response: {0}'.format(cmdret))
|
||||
|
||||
|
||||
def _get_jid_snapshots(jid, config='root'):
|
||||
|
@ -648,12 +647,9 @@ def diff(config='root', filename=None, num_pre=None, num_post=None):
|
|||
if filepath.startswith(SUBVOLUME):
|
||||
_filepath = filepath[len(SUBVOLUME):]
|
||||
|
||||
pre_file = os.path.normpath(pre_mount + "/" + _filepath)
|
||||
post_file = os.path.normpath(post_mount + "/" + _filepath)
|
||||
|
||||
# Just in case, removing posible double '/' from the final file paths
|
||||
pre_file = pre_file.replace("//", "/")
|
||||
post_file = post_file.replace("//", "/")
|
||||
pre_file = os.path.normpath(pre_mount + "/" + _filepath).replace("//", "/")
|
||||
post_file = os.path.normpath(post_mount + "/" + _filepath).replace("//", "/")
|
||||
|
||||
if os.path.isfile(pre_file):
|
||||
pre_file_exists = True
|
||||
|
|
|
@ -198,7 +198,6 @@ def baseline_snapshot(name, number=None, tag=None, include_diff=True, config='ro
|
|||
num_post=number,
|
||||
filename=file).get(file, {}))
|
||||
|
||||
|
||||
if __opts__['test'] and status:
|
||||
ret['pchanges'] = status
|
||||
ret['changes'] = ret['pchanges']
|
||||
|
|
Loading…
Add table
Reference in a new issue