|
|
@ -212,6 +212,7 @@ group:
|
|
|
|
|
|
|
|
|
|
|
|
__version__ = '${version}'
|
|
|
|
__version__ = '${version}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
from distutils.version import LooseVersion
|
|
|
|
from distutils.version import LooseVersion
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -234,6 +235,8 @@ except ImportError:
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
CLC_FOUND = True
|
|
|
|
CLC_FOUND = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClcGroup(object):
|
|
|
|
class ClcGroup(object):
|
|
|
|
|
|
|
|
|
|
|
@ -362,7 +365,7 @@ class ClcGroup(object):
|
|
|
|
group, parent = self.group_dict.get(group_name)
|
|
|
|
group, parent = self.group_dict.get(group_name)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
response = group.Delete()
|
|
|
|
response = group.Delete()
|
|
|
|
except CLCException, ex:
|
|
|
|
except CLCException as ex:
|
|
|
|
self.module.fail_json(msg='Failed to delete group :{0}. {1}'.format(
|
|
|
|
self.module.fail_json(msg='Failed to delete group :{0}. {1}'.format(
|
|
|
|
group_name, ex.response_text
|
|
|
|
group_name, ex.response_text
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -423,7 +426,7 @@ class ClcGroup(object):
|
|
|
|
(parent, grandparent) = self.group_dict[parent]
|
|
|
|
(parent, grandparent) = self.group_dict[parent]
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
response = parent.Create(name=group, description=description)
|
|
|
|
response = parent.Create(name=group, description=description)
|
|
|
|
except CLCException, ex:
|
|
|
|
except CLCException as ex:
|
|
|
|
self.module.fail_json(msg='Failed to create group :{0}. {1}'.format(
|
|
|
|
self.module.fail_json(msg='Failed to create group :{0}. {1}'.format(
|
|
|
|
group, ex.response_text))
|
|
|
|
group, ex.response_text))
|
|
|
|
return response
|
|
|
|
return response
|
|
|
@ -508,6 +511,6 @@ def main():
|
|
|
|
clc_group = ClcGroup(module)
|
|
|
|
clc_group = ClcGroup(module)
|
|
|
|
clc_group.process_request()
|
|
|
|
clc_group.process_request()
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import * # pylint: disable=W0614
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|