Handle test=True correctly for tablespace owner

We weren't handling test=True correctly for when the table already existed, but
the owner was changing.
This commit is contained in:
Brian Jackson 2015-04-23 12:04:20 -05:00
parent 17baaa9f8c
commit e23f4bf8e8

View file

@ -79,7 +79,11 @@ def present(name,
ret['result'] = False
return ret # This isn't changeable, they need to remove/remake
if (not owner and not tblspaces[name]['Owner'] == owner):
if (owner and not tblspaces[name]['Owner'] == owner):
if __opts__['test']:
ret['result'] = None
ret['comment'] = 'Tablespace {0} owner to be altered'.format(name)
return ret
if __salt__['postgres_ext.tablespace_alter'](name, new_owner=owner):
ret['comment'] = 'Tablespace {0} owner changed'.format(name)
ret['result'] = True