From a3b5c3424d6b12ffcac4096ee2fe81af2b7c2408 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Tue, 9 Mar 2021 13:22:13 -0500 Subject: [PATCH] Sync bitbucket and GitHub --- ansible_collections/netapp/ontap/README.md | 5 +++++ .../ontap/changelogs/fragments/DEVOPS-3754.yaml | 2 ++ ansible_collections/netapp/ontap/galaxy.yml | 4 +++- .../netapp/ontap/plugins/module_utils/netapp.py | 2 +- .../ontap/plugins/modules/na_ontap_snapmirror.py | 16 +++++++++------- 5 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 ansible_collections/netapp/ontap/changelogs/fragments/DEVOPS-3754.yaml diff --git a/ansible_collections/netapp/ontap/README.md b/ansible_collections/netapp/ontap/README.md index 12307aa5..2e31f941 100644 --- a/ansible_collections/netapp/ontap/README.md +++ b/ansible_collections/netapp/ontap/README.md @@ -27,6 +27,11 @@ Join our Slack Channel at [Netapp.io](http://netapp.io/slack) # Release Notes +## 21.3.1 + +### Bug fixes + - na_ontap_snapmirror: check for consistency_group_volumes always fails on 9.7. + ## 21.3.0 ### New Modules diff --git a/ansible_collections/netapp/ontap/changelogs/fragments/DEVOPS-3754.yaml b/ansible_collections/netapp/ontap/changelogs/fragments/DEVOPS-3754.yaml new file mode 100644 index 00000000..85c83842 --- /dev/null +++ b/ansible_collections/netapp/ontap/changelogs/fragments/DEVOPS-3754.yaml @@ -0,0 +1,2 @@ +bugfixes: + - na_ontap_snapmirror - check for consistency_group_volumes always fails on 9.7. diff --git a/ansible_collections/netapp/ontap/galaxy.yml b/ansible_collections/netapp/ontap/galaxy.yml index ebbd33df..fa5c20e0 100644 --- a/ansible_collections/netapp/ontap/galaxy.yml +++ b/ansible_collections/netapp/ontap/galaxy.yml @@ -1,6 +1,6 @@ namespace: "netapp" name: "ontap" -version: "21.3.0" +version: "21.3.1" authors: - "NetApp Ansible Team " license: "GPL-2.0-or-later" @@ -10,3 +10,5 @@ repository: https://github.com/ansible-collections/netapp homepage: https://netapp.io/configuration-management-and-automation/ tags: - storage + - ontap + - netapp diff --git a/ansible_collections/netapp/ontap/plugins/module_utils/netapp.py b/ansible_collections/netapp/ontap/plugins/module_utils/netapp.py index e32548f2..70489e1b 100644 --- a/ansible_collections/netapp/ontap/plugins/module_utils/netapp.py +++ b/ansible_collections/netapp/ontap/plugins/module_utils/netapp.py @@ -47,7 +47,7 @@ except ImportError: ansible_version = 'unknown' -COLLECTION_VERSION = "21.3.0" +COLLECTION_VERSION = "21.3.1" CLIENT_APP_VERSION = "%s/" + COLLECTION_VERSION IMPORT_EXCEPTION = None diff --git a/ansible_collections/netapp/ontap/plugins/modules/na_ontap_snapmirror.py b/ansible_collections/netapp/ontap/plugins/modules/na_ontap_snapmirror.py index 5ad542c9..3a45fa43 100644 --- a/ansible_collections/netapp/ontap/plugins/modules/na_ontap_snapmirror.py +++ b/ansible_collections/netapp/ontap/plugins/modules/na_ontap_snapmirror.py @@ -546,7 +546,6 @@ def __init__(self): self.na_helper = NetAppModule() self.parameters = self.na_helper.set_parameters(self.module.params) self.new_style = False - self.warnings = list() # setup later if required self.source_server = None # only for ElementSW -> ONTAP snapmirroring, validate if ElementSW SDK is available @@ -746,8 +745,8 @@ def set_initialization_state(self): def get_create_body(self): initialized = False body = dict( - source=self.na_helper.filter_out_none_entries(self.parameters['source_endpoint']), - destination=self.na_helper.filter_out_none_entries(self.parameters['destination_endpoint']), + source=self.parameters['source_endpoint'], + destination=self.parameters['destination_endpoint'], ) if self.na_helper.safe_get(self.parameters, ['create_destination', 'enabled']): # testing for True body['create_destination'] = self.na_helper.filter_out_none_entries(self.parameters['create_destination']) @@ -1058,10 +1057,10 @@ def too_old(minimum_generation, minimum_major): for option in ['source_cluster', 'source_path', 'source_volume', 'source_vserver']: if option in self.parameters: - self.warnings.append('option: %s is deprecated, please use %s' % (option, new_option(option, 'source_'))) + self.module.warn('option: %s is deprecated, please use %s' % (option, new_option(option, 'source_'))) for option in ['destination_cluster', 'destination_path', 'destination_volume', 'destination_vserver']: if option in self.parameters: - self.warnings.append('option: %s is deprecated, please use %s' % (option, new_option(option, 'destination_'))) + self.module.warn('option: %s is deprecated, please use %s' % (option, new_option(option, 'destination_'))) ontap_97_options = ['create_destination'] if too_old(9, 7) and any(x in self.parameters for x in ontap_97_options): @@ -1069,11 +1068,16 @@ def too_old(minimum_generation, minimum_major): if self.parameters.get('source_endpoint') or self.parameters.get('destination_endpoint'): if not self.parameters.get('destination_endpoint') or not self.parameters.get('source_endpoint'): self.module.fail_json(msg='Missing parameters: Source endpoint or Destination endpoint') + # sanitize inputs + self.parameters['source_endpoint'] = self.na_helper.filter_out_none_entries(self.parameters['source_endpoint']) + self.parameters['destination_endpoint'] = self.na_helper.filter_out_none_entries(self.parameters['destination_endpoint']) + # options requiring 9.7 or better, and REST ontap_97_options = ['cluster', 'ipspace'] if too_old(9, 7) and any(x in self.parameters['source_endpoint'] for x in ontap_97_options): self.module.fail_json(msg='Error: %s' % self.rest_api.options_require_ontap_version(ontap_97_options, version='9.7')) if too_old(9, 7) and any(x in self.parameters['destination_endpoint'] for x in ontap_97_options): self.module.fail_json(msg='Error: %s' % self.rest_api.options_require_ontap_version(ontap_97_options, version='9.7')) + # options requiring 9.8 or better, and REST ontap_98_options = ['consistency_group_volumes'] if too_old(9, 8) and any(x in self.parameters['source_endpoint'] for x in ontap_98_options): self.module.fail_json(msg='Error: %s' % self.rest_api.options_require_ontap_version(ontap_98_options, version='9.8')) @@ -1333,8 +1337,6 @@ def apply(self): results['actions'] = actions if response: results['response'] = response - if self.warnings: - results['warnings'] = self.warnings self.module.exit_json(**results)