1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixing missing modify_client_match function and get_export_policy_rule function logic (#44164)

This commit is contained in:
Milan Zink 2018-08-28 13:25:16 +02:00 committed by John R Barker
parent 06a5e6ae0f
commit 2fab2d5775

View file

@ -203,9 +203,9 @@ class NetAppontapExportRule(object):
rule_info.add_new_child('policy-name', self.policy_name)
if self.vserver:
rule_info.add_new_child('vserver-name', self.vserver)
else:
if self.client_match:
rule_info.add_new_child('client-match', self.client_match)
if self.client_match:
rule_info.add_new_child('client-match', self.client_match)
query = netapp_utils.zapi.NaElement('query')
query.add_child_elem(rule_info)
@ -254,6 +254,7 @@ class NetAppontapExportRule(object):
return_value = {
'policy-name': self.policy_name
}
return return_value
def get_export_policy(self):
@ -422,6 +423,22 @@ class NetAppontapExportRule(object):
self.module.fail_json(msg='Error modifying super_user_security %s: %s' % (self.super_user_security, to_native(error)),
exception=traceback.format_exc())
def modify_client_match(self, rule_index):
"""
Modify client_match.
"""
export_rule_modify_client_match = netapp_utils.zapi.NaElement.create_node_with_children(
'export-rule-modify',
**{'policy-name': self.policy_name,
'rule-index': rule_index,
'client-match': str(self.client_match)})
try:
self.server.invoke_successfully(export_rule_modify_client_match,
enable_tunneling=True)
except netapp_utils.zapi.NaApiError as error:
self.module.fail_json(msg='Error modifying client_match %s: %s' % (self.client_match, to_native(error)),
exception=traceback.format_exc())
def modify_allow_suid(self, rule_index):
"""
Modify allow_suid.