mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
added change detection for block device tune, reformatting
This commit is contained in:
parent
0bced7a2ca
commit
5c526b2670
@ -76,15 +76,15 @@ def tuned(name, **kwargs):
|
||||
changes = __salt__['blockdev.tune'](name, **kwargs)
|
||||
changeset = {}
|
||||
for key in changes:
|
||||
if current[key] != changes[key]:
|
||||
changeset[key] = 'Changed from {0} to {1}'.format(current[key], changes[key])
|
||||
if current[key] != changes[key]:
|
||||
changeset[key] = 'Changed from {0} to {1}'.format(current[key], changes[key])
|
||||
if changes:
|
||||
if changeset:
|
||||
ret['comment'] = ('Block device {0} '
|
||||
'successfully modified ').format(name)
|
||||
ret['changes'] = changeset
|
||||
else:
|
||||
ret['comment'] = 'Block device {0} already in correct state'.format(name)
|
||||
ret['comment'] = ('Block device {0} '
|
||||
'successfully modified ').format(name)
|
||||
ret['changes'] = changeset
|
||||
else:
|
||||
ret['comment'] = 'Block device {0} already in correct state'.format(name)
|
||||
else:
|
||||
ret['comment'] = 'Failed to modify block device {0}'.format(name)
|
||||
ret['result'] = False
|
||||
|
Loading…
Reference in New Issue
Block a user