mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #32174 from sjorge/2016.3-smartos-change
smartos state would show changes even if there were none
This commit is contained in:
commit
43ef524370
@ -685,7 +685,7 @@ def vm_present(name, vmconfig, config=None):
|
||||
if __opts__['test']:
|
||||
ret['changes'][vmconfig['state']['hostname']] = vmconfig['changed']
|
||||
|
||||
if len(ret['changes']) > 0:
|
||||
if vmconfig['state']['hostname'] in ret['changes'] and len(ret['changes'][vmconfig['state']['hostname']]) > 0:
|
||||
ret['comment'] = 'vm {0} updated'.format(vmconfig['state']['hostname'])
|
||||
if config['kvm_reboot'] and vmconfig['current']['brand'] == 'kvm' and not __opts__['test']:
|
||||
if vmconfig['state']['hostname'] in __salt__['vmadm.list'](order='hostname', search='state=running'):
|
||||
@ -693,6 +693,7 @@ def vm_present(name, vmconfig, config=None):
|
||||
if kvm_needs_start:
|
||||
__salt__['vmadm.start'](vm=vmconfig['state']['hostname'], key='hostname')
|
||||
else:
|
||||
ret['changes'] = {}
|
||||
ret['comment'] = 'vm {0} is up to date'.format(vmconfig['state']['hostname'])
|
||||
|
||||
if 'image_uuid' in vmconfig['current'] and vmconfig['reprovision_uuid'] != vmconfig['current']['image_uuid']:
|
||||
|
Loading…
Reference in New Issue
Block a user