Skip to content

Commit

Permalink
Sync bitbucket and GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
carchi8py committed Sep 1, 2021
1 parent f9c9ea4 commit 2dd03e8
Show file tree
Hide file tree
Showing 12 changed files with 499 additions and 195 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ NetApp ONTAP Collection Release Notes
.. contents:: Topics


v21.11.0
========

Minor Changes
-------------

- na_ontap_interface - new option ``from_name`` to rename an interface.
- na_ontap_ntp - Added REST support to the ntp module
- na_ontap_ntp - Added REST support to the ntp module
- na_ontap_software_update - new option ``validate_after_download`` to run ONTAP software update validation checks.
- na_ontap_software_update - remove ``absent`` as a choice for ``state`` as it has no use.
- na_ontap_svm - ignore ``aggr_list`` with ``'*'`` when using REST.
- na_ontap_svm - new option ``ignore_rest_unsupported_options`` to ignore older ZAPI options not available in REST.
- na_ontap_svm - new option ``services`` to allow and/or enable protocol services.

Bugfixes
--------

- na_ontap_job_schedule - fix idempotency issue with REST when job_minutes is set to -1.
- na_ontap_ldap_client - remove limitation on schema so that custom schemas can be used.

v21.10.0
========

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ Join our Slack Channel at [Netapp.io](http://netapp.io/slack)
### Minor Changes
- na_ontap_software_update - remove `absent` as a choice for `state` as it has no use.
- na_ontap_svm - ignore `aggr_list: '*'` when using REST.

### Bug Fixes
- na_ontap_job_schedule - fix idempotency issue with REST when job_minutes is set to -1.
- na_ontap_ldap_client - remove limitation on schema so that custom schemas can be used.

### Added REST support to existing modules
- na_ontap_ntp - Added REST support to the ntp module

## 21.10.0

### Minor Changes
Expand All @@ -51,6 +55,7 @@ Join our Slack Channel at [Netapp.io](http://netapp.io/slack)
- na_ontap_vserver_delete role - delete iSCSI igroups and CIFS server before deleting vserver.
- all modules - traceback on ONTAP 9.3 (and earlier) when trying to detect REST support.


## 21.9.0

### Minor Changes
Expand Down
44 changes: 36 additions & 8 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ releases:
- na_ontap_vserver_cifs_security - fix int and boolean options when modifying
vserver cifs security.
minor_changes:
- "Added REST support to existing modules.\n By default, the module will use\
\ REST if the target system supports it, and the options are supported. Otherwise,\
\ it will switch back to ZAPI.\n This behavior can be controlled with the\
\ ``use_rest`` option.\n Always - to force REST. The module fails and reports\
\ an error if REST cannot be used.\n Never - to force ZAPI. This could be\
\ useful if you find some incompatibility with REST, or want to confirm the\
\ behavior is identical between REST and ZAPI.\n Auto - the default, as described\
\ above.\n"
- "Added REST support to existing modules.\n By default, the module will use
REST if the target system supports it, and the options are supported. Otherwise,
it will switch back to ZAPI.\n This behavior can be controlled with the ``use_rest``
option.\n Always - to force REST. The module fails and reports an error
if REST cannot be used.\n Never - to force ZAPI. This could be useful if
you find some incompatibility with REST, or want to confirm the behavior is
identical between REST and ZAPI.\n Auto - the default, as described above.\n"
- na_ontap_cluster_config - role updated to support a cleaner playbook
- na_ontap_command - ``vserver`` - to allow command to run as either cluster
admin or vserver admin. To run as vserver admin you must use the vserver
Expand Down Expand Up @@ -1061,6 +1060,35 @@ releases:
- DEVOPS-4190.yaml
- DEVOPS-4231.yaml
release_date: '2021-08-12'
21.11.0:
changes:
bugfixes:
- na_ontap_job_schedule - fix idempotency issue with REST when job_minutes is
set to -1.
- na_ontap_ldap_client - remove limitation on schema so that custom schemas
can be used.
minor_changes:
- na_ontap_interface - new option ``from_name`` to rename an interface.
- na_ontap_ntp - Added REST support to the ntp module
- na_ontap_ntp - Added REST support to the ntp module
- na_ontap_software_update - new option ``validate_after_download`` to run ONTAP
software update validation checks.
- na_ontap_software_update - remove ``absent`` as a choice for ``state`` as
it has no use.
- na_ontap_svm - ignore ``aggr_list`` with ``'*'`` when using REST.
- na_ontap_svm - new option ``ignore_rest_unsupported_options`` to ignore older
ZAPI options not available in REST.
- na_ontap_svm - new option ``services`` to allow and/or enable protocol services.
fragments:
- DEVOPS-2459.yaml
- DEVOPS-2459.yml
- DEVOPS-4218.yaml
- DEVOPS-4227.yaml
- DEVOPS-4235.yaml
- DEVOPS-4243.yaml
- DEVOPS-4255.yaml
- DEVOPS-4256.yaml
release_date: '2021-09-01'
21.2.0:
changes:
bugfixes:
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/DEVOPS-2459.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- na_ontap_ntp - Added REST support to the ntp module
2 changes: 2 additions & 0 deletions changelogs/fragments/DEVOPS-4227.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- na_ontap_job_schedule - fix idempotency issue with REST when job_minutes is set to -1.
35 changes: 16 additions & 19 deletions plugins/module_utils/netapp_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,25 @@ class NetAppModule(object):

def __init__(self, module=None):
self.module = module
self.log = list()
self.log = []
self.changed = False
self.parameters = {'name': 'not initialized'}
self.zapi_string_keys = dict()
self.zapi_bool_keys = dict()
self.zapi_list_keys = dict()
self.zapi_int_keys = dict()
self.zapi_required = dict()
self.zapi_string_keys = {}
self.zapi_bool_keys = {}
self.zapi_list_keys = {}
self.zapi_int_keys = {}
self.zapi_required = {}
self.params_to_rest_api_keys = {}

def set_parameters(self, ansible_params):
self.parameters = dict()
self.parameters = {}
for param in ansible_params:
if ansible_params[param] is not None:
self.parameters[param] = ansible_params[param]
return self.parameters

def check_and_set_parameters(self, module):
self.parameters = dict()
self.parameters = {}
check_for_none = netapp_utils.has_feature(module, 'check_required_params_for_none')
if check_for_none:
required_keys = [key for key, value in module.argument_spec.items() if value.get('required')]
Expand Down Expand Up @@ -177,11 +178,7 @@ def get_cd_action(self, current, desired):
is_present = 'present'
action = cd_action(current=is_present, desired = self.desired.state())
'''
if 'state' in desired:
desired_state = desired['state']
else:
desired_state = 'present'

desired_state = desired['state'] if 'state' in desired else 'present'
if current is None and desired_state == 'absent':
return None
if current is not None and desired_state == 'present':
Expand All @@ -193,7 +190,7 @@ def get_cd_action(self, current, desired):
return 'create'

def compare_and_update_values(self, current, desired, keys_to_compare):
updated_values = dict()
updated_values = {}
is_changed = False
for key in keys_to_compare:
if key in current:
Expand Down Expand Up @@ -237,7 +234,7 @@ def compare_lists(current, desired, get_list_diff):
desired_diff_list.append(item)

# get what in current but not in desired
current_diff_list = list()
current_diff_list = []
for item in current:
if item in desired_copy:
desired_copy.remove(item)
Expand Down Expand Up @@ -269,7 +266,7 @@ def get_modified_attributes(self, current, desired, get_list_diff=False):
aggregate name)
'''
# if the object does not exist, we can't modify it
modified = dict()
modified = {}
if current is None:
return modified

Expand Down Expand Up @@ -318,7 +315,7 @@ def is_rename_action(self, source, target):
# idempotency (or) new_name_is_already_in_use
# alternatively we could delete B and rename A to B
return False
if source is None and target is not None:
if source is None:
# do nothing, maybe the rename was already done
return False
# source is not None and target is None:
Expand Down Expand Up @@ -446,7 +443,7 @@ def filter_out_none_entries(self, list_or_dict):
"""

if isinstance(list_or_dict, dict):
result = dict()
result = {}
for key, value in list_or_dict.items():
if isinstance(value, (list, dict)):
sub = self.filter_out_none_entries(value)
Expand All @@ -459,7 +456,7 @@ def filter_out_none_entries(self, list_or_dict):
return result

if isinstance(list_or_dict, list):
alist = list()
alist = []
for item in list_or_dict:
if isinstance(item, (list, dict)):
sub = self.filter_out_none_entries(item)
Expand Down
Loading

0 comments on commit 2dd03e8

Please sign in to comment.