diff --git a/salt/modules/win_system.py b/salt/modules/win_system.py index 10ee883564..877d40e71c 100644 --- a/salt/modules/win_system.py +++ b/salt/modules/win_system.py @@ -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(): diff --git a/salt/states/win_system.py b/salt/states/win_system.py index 33cab2155b..3ed03c861f 100644 --- a/salt/states/win_system.py +++ b/salt/states/win_system.py @@ -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