Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing modify_client_match and get_export_policy_rule #44164

Merged
merged 1 commit into from
Aug 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 20 additions & 3 deletions lib/ansible/modules/storage/netapp/na_ontap_export_policy_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def get_export_policy_rule(self):
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)
Expand Down Expand Up @@ -253,6 +253,7 @@ def get_export_policy_rule(self):
return_value = {
'policy-name': self.policy_name
}

return return_value

def get_export_policy(self):
Expand Down Expand Up @@ -424,6 +425,22 @@ def modify_super_user_security(self, rule_index):
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.
Expand Down