mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 01:30:25 +00:00
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:
parent
17baaa9f8c
commit
e23f4bf8e8
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue