Skip to content

Commit

Permalink
fixes (ansible#58598)
Browse files Browse the repository at this point in the history
  • Loading branch information
carchi8py authored and ansibot committed Jul 2, 2019
1 parent 63bdd0d commit 30a7670
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# (c) 2018, NetApp, Inc
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
Expand Down Expand Up @@ -163,6 +163,7 @@ def get_scanner_pool(self):
scanner_pool_obj = netapp_utils.zapi.NaElement('vscan-scanner-pool-get-iter')
scanner_pool_info = netapp_utils.zapi.NaElement('scan-scanner-pool-info')
scanner_pool_info.add_new_child('scanner-pool', self.scanner_pool)
scanner_pool_info.add_new_child('vserver', self.vserver)
query = netapp_utils.zapi.NaElement('query')
query.add_child_elem(scanner_pool_info)
scanner_pool_obj.add_child_elem(query)
Expand All @@ -172,7 +173,7 @@ def get_scanner_pool(self):
self.module.fail_json(msg='Error searching for Vscan Scanner Pool %s: %s' %
(self.scanner_pool, to_native(error)),
exception=traceback.format_exc())
if result.get_child_by_name('num-records'):
if result.get_child_by_name('num-records') and int(result.get_child_content('num-records')) >= 1:
if result.get_child_by_name('attributes-list').get_child_by_name('vscan-scanner-pool-info').get_child_content(
'scanner-pool') == self.scanner_pool:
return result.get_child_by_name('attributes-list').get_child_by_name('vscan-scanner-pool-info')
Expand Down Expand Up @@ -216,9 +217,10 @@ def apply(self):
changed = True
# apply Scanner policy
if scanner_pool_obj:
if scanner_pool_obj.get_child_content('scanner-policy') != self.scanner_policy:
self.apply_policy()
changed = True
if self.scanner_policy:
if scanner_pool_obj.get_child_content('scanner-policy') != self.scanner_policy:
self.apply_policy()
changed = True
if self.state == 'absent':
if scanner_pool_obj:
self.delete_scanner_pool()
Expand Down

0 comments on commit 30a7670

Please sign in to comment.