From 809de4e033d1e37c75d72d704470a57f0dbaea9c Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Tue, 19 Mar 2019 07:48:23 -0700 Subject: [PATCH] Bug Fix to na_ontap_iscsi (#53871) * Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * Revert "Revert "changes to clusteR"" This reverts commit f1104a37b42886aebb4d2b2ab27c91c96d97858a. * Revert "Revert "changes to clusteR"" This reverts commit f1104a37b42886aebb4d2b2ab27c91c96d97858a. * Revert "documentation changes" This reverts commit 02c369d0414fdff492d90865c903bdade3174261. * fix bug * fix bug * Revert "Revert "documentation changes"" This reverts commit 97de518686c51dde83eb4512f1c3ab284308fc4c. --- lib/ansible/modules/storage/netapp/na_ontap_iscsi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_iscsi.py b/lib/ansible/modules/storage/netapp/na_ontap_iscsi.py index 26c2b0ee17..07dcbed78e 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_iscsi.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_iscsi.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# (c) 2017, NetApp, Inc +# (c) 2017-2019, NetApp, Inc # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) @@ -249,10 +249,10 @@ class NetAppOntapISCSI(object): else: if self.state == 'present': if not iscsi_service_exists: - self.create_iscsi_service() - elif self.service_state == 'started': + self.create_iscsi_service() # the service is stopped when initially created + if self.service_state == 'started': self.start_iscsi_service() - else: + if iscsi_service_exists and self.service_state == 'stopped': self.stop_iscsi_service() elif self.state == 'absent':