From 374a22f4c73471a7616a412f75a73bfa3dc2fa3f Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Fri, 17 Aug 2018 06:21:50 -0700 Subject: [PATCH] Bug Fixes for ontap_user.py (#44222) --- lib/ansible/modules/storage/netapp/na_ontap_user.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_user.py b/lib/ansible/modules/storage/netapp/na_ontap_user.py index a8e429c461c..28cddeb7f3a 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_user.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_user.py @@ -20,7 +20,7 @@ short_description: useradmin configuration and management extends_documentation_fragment: - netapp.na_ontap version_added: '2.6' -author: Sumit Kumar (sumit4@netapp.com) +author: NetApp Ansible Team (ng-ansibleteam@netapp.com) description: - Create or destroy users. @@ -42,7 +42,7 @@ options: description: - Application to grant access to. required: true - choices: ['console', 'http','ontapi','rsh','snmp','sp','ssh','telnet'] + choices: ['console', 'http','ontapi','rsh','snmp','service-processor','sp','ssh','telnet'] authentication_method: description: @@ -127,7 +127,7 @@ class NetAppOntapUser(object): application=dict(required=True, type='str', choices=[ 'console', 'http', 'ontapi', 'rsh', - 'snmp', 'sp', 'ssh', 'telnet']), + 'snmp', 'sp', 'service-processor', 'ssh', 'telnet']), authentication_method=dict(required=True, type='str', choices=['community', 'password', 'publickey', 'domain', @@ -199,6 +199,9 @@ class NetAppOntapUser(object): # Error 16034 denotes a user not being found. if to_native(error.code) == "16034": return False + # Error 16043 denotes the user existing, but the application missing + elif to_native(error.code) == "16043": + return False else: self.module.fail_json(msg='Error getting user %s: %s' % (self.name, to_native(error)), exception=traceback.format_exc()) @@ -293,6 +296,7 @@ class NetAppOntapUser(object): else: self.module.fail_json(msg='Error unlocking user %s: %s' % (self.name, to_native(error)), exception=traceback.format_exc()) + return True def delete_user(self): user_delete = netapp_utils.zapi.NaElement.create_node_with_children(