diff options
author | Tobias Rüetschi <tobias.ruetschi@adfinis-sygroup.ch> | 2016-06-07 14:48:58 +0200 |
---|---|---|
committer | Tobias Rueetschi <tr@brief.li> | 2016-08-29 09:11:56 +0200 |
commit | a8881721735c570089568f92836c6da3b40a2710 (patch) | |
tree | 7d4d09001863bdc04ade8fc52238449e57de2276 /univention | |
parent | 6521ad31b1f18d7d4e0b3bab4a68858bcaa654c7 (diff) | |
download | ansible-modules-extras-a8881721735c570089568f92836c6da3b40a2710.tar.gz |
UCS udm_share: fix creating of new shares
Diffstat (limited to 'univention')
-rw-r--r-- | univention/udm_share.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/univention/udm_share.py b/univention/udm_share.py index a046f3e3..deb76742 100644 --- a/univention/udm_share.py +++ b/univention/udm_share.py @@ -271,7 +271,7 @@ def main(): sambaMSDFSRoot = dict(type='str', default='0'), sambaName = dict(type='str', - default=''), + default=None), sambaNtAclSupport = dict(type='str', default='1'), sambaOplocks = dict(type='str', @@ -329,15 +329,18 @@ def main(): obj[k] = module.params[k] diff = obj.diff() - for k in obj.keys(): - if obj.hasChanged(k): - changed=True + if exists: + for k in obj.keys(): + if obj.hasChanged(k): + changed=True + else: + changed=True if not module.check_mode: if not exists: obj.create() elif changed: obj.modify() - except BaseException as e: + except Exception as e: module.fail_json( msg='Creating/editing share {} in {} failed: {}'.format(name, container, e) ) |