Fix system.set_computer_desc

This would always return that the description had been changed,
resulting in the corresponding state always thinking the change had been
successful. This commit fixes that behavior.
This commit is contained in:
Erik Johnson 2013-10-09 21:12:05 -05:00
parent 46520512a6
commit fc9afc708a
2 changed files with 7 additions and 7 deletions

View File

@ -205,7 +205,7 @@ def set_computer_desc(desc):
'''
cmd = 'net config server /srvcomment:"{0}"'.format(desc)
__salt__['cmd.run'](cmd)
return {'Computer Description': str(desc)}
return {'Computer Description': get_computer_desc()}
def get_computer_desc():

View File

@ -64,15 +64,15 @@ def computer_desc(name):
.format(name))
return ret
if not __salt__['system.set_computer_desc'](name):
ret['result'] = False
ret['comment'] = ('Unable to set computer description to '
'{0!r}'.format(name))
else:
result = __salt__['system.set_computer_desc'](name)
if result['Computer Description'] == name:
ret['comment'] = ('Computer description successfully changed to {0!r}'
.format(name))
ret['changes'] = {'old': before_desc, 'new': name}
else:
ret['result'] = False
ret['comment'] = ('Unable to set computer description to '
'{0!r}'.format(name))
return ret
computer_description = computer_desc