From d558a380de1d53c1ab4e99a855a7f1d7b9a3fd62 Mon Sep 17 00:00:00 2001 From: meenakshidembi691 Date: Wed, 24 Apr 2024 15:58:25 +0530 Subject: [PATCH] Squash the commits --- CHANGELOG.rst | 7 + README.md | 104 ++-- changelogs/changelog.yaml | 5 + codecov.yml | 3 +- docs/CONTRIBUTING.md | 8 +- docs/INSTALLATION.md | 4 +- docs/ISSUE_TRIAGE.md | 2 +- docs/MAINTAINER_GUIDE.md | 2 +- docs/Release Notes.md | 9 +- docs/SECURITY.md | 2 +- docs/modules/certificate.rst | 2 +- docs/modules/cluster.rst | 2 +- docs/modules/dns.rst | 2 +- docs/modules/email.rst | 2 +- docs/modules/file_dns.rst | 2 +- docs/modules/file_interface.rst | 2 +- docs/modules/file_nis.rst | 2 +- docs/modules/filesystem.rst | 2 +- docs/modules/filesystem_snapshot.rst | 2 +- docs/modules/host.rst | 2 +- docs/modules/hostgroup.rst | 2 +- docs/modules/info.rst | 2 +- docs/modules/job.rst | 2 +- docs/modules/ldap_account.rst | 2 +- docs/modules/ldap_domain.rst | 2 +- docs/modules/local_user.rst | 2 +- docs/modules/nasserver.rst | 2 +- docs/modules/network.rst | 2 +- docs/modules/nfs.rst | 2 +- docs/modules/nfs_server.rst | 2 +- docs/modules/ntp.rst | 2 +- docs/modules/protectionpolicy.rst | 2 +- docs/modules/quota.rst | 2 +- docs/modules/remote_support.rst | 2 +- docs/modules/remote_support_contact.rst | 2 +- docs/modules/remotesystem.rst | 2 +- docs/modules/replicationrule.rst | 2 +- docs/modules/replicationsession.rst | 2 +- docs/modules/role.rst | 2 +- docs/modules/security_config.rst | 3 +- docs/modules/service_config.rst | 2 +- docs/modules/smb_server.rst | 2 +- docs/modules/smbshare.rst | 2 +- docs/modules/smtp_config.rst | 2 +- docs/modules/snapshot.rst | 2 +- docs/modules/snapshotrule.rst | 2 +- docs/modules/storage_container.rst | 2 +- docs/modules/vcenter.rst | 2 +- docs/modules/volume.rst | 3 +- docs/modules/volumegroup.rst | 2 +- galaxy.yml | 8 +- plugins/module_utils/storage/dell/utils.py | 2 +- plugins/modules/certificate.py | 2 +- plugins/modules/cluster.py | 2 +- plugins/modules/dns.py | 2 +- plugins/modules/email.py | 2 +- plugins/modules/file_dns.py | 2 +- plugins/modules/file_interface.py | 2 +- plugins/modules/file_nis.py | 2 +- plugins/modules/filesystem.py | 2 +- plugins/modules/filesystem_snapshot.py | 2 +- plugins/modules/host.py | 2 +- plugins/modules/hostgroup.py | 2 +- plugins/modules/info.py | 2 +- plugins/modules/job.py | 2 +- plugins/modules/ldap_account.py | 2 +- plugins/modules/ldap_domain.py | 2 +- plugins/modules/local_user.py | 2 +- plugins/modules/nasserver.py | 2 +- plugins/modules/network.py | 2 +- plugins/modules/nfs.py | 2 +- plugins/modules/nfs_server.py | 2 +- plugins/modules/ntp.py | 2 +- plugins/modules/protectionpolicy.py | 2 +- plugins/modules/quota.py | 2 +- plugins/modules/remote_support.py | 2 +- plugins/modules/remote_support_contact.py | 2 +- plugins/modules/remotesystem.py | 2 +- plugins/modules/replicationrule.py | 2 +- plugins/modules/replicationsession.py | 2 +- plugins/modules/role.py | 2 +- plugins/modules/security_config.py | 4 +- plugins/modules/service_config.py | 2 +- plugins/modules/smb_server.py | 2 +- plugins/modules/smbshare.py | 2 +- plugins/modules/smtp_config.py | 2 +- plugins/modules/snapshot.py | 2 +- plugins/modules/snapshotrule.py | 2 +- plugins/modules/storage_container.py | 2 +- plugins/modules/vcenter.py | 2 +- plugins/modules/volume.py | 54 +- plugins/modules/volumegroup.py | 2 +- requirements.txt | 1 + tests/sanity/ignore-2.18.txt | 40 ++ .../mock_filesystem_snapshot_api.py | 113 +--- .../module_utils/mock_security_config_api.py | 11 + .../plugins/module_utils/mock_volume_api.py | 26 +- .../modules/test_filesystem_snapshot.py | 575 ++++++++++++++---- .../plugins/modules/test_security_config.py | 87 ++- tests/unit/plugins/modules/test_volume.py | 22 +- 100 files changed, 824 insertions(+), 423 deletions(-) create mode 100644 tests/sanity/ignore-2.18.txt diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c027226..4730106 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,13 @@ Dellemc.Powerstore Change Logs .. contents:: Topics +v3.3.0 +====== + +Minor Changes +------------- + +- Added the support for PowerStore version 4.0.0.0 (Victory Release) v3.2.0 ====== diff --git a/README.md b/README.md index c5d0fb9..00d05b8 100644 --- a/README.md +++ b/README.md @@ -4,29 +4,29 @@ The Ansible Modules for Dell Technologies (Dell) PowerStore allow Data Center an The capabilities of the Ansible modules are managing volumes, volume groups, vCenters, hosts, host groups, snapshots, snapshot rules, replication rules, replication sessions, protection policies, file systems, NAS servers, SMB shares, user and tree quotas, file system snapshots, NFS exports, Clusters, Networks, Local users, Jobs, Roles, Certificates, Remote systems, security configuration, DNS server, Email notification destination, NTP server, Remote support configuration, Remote support contacts, SMTP configuration, LDAP accounts, LDAP domain configuration, storage containers, File DNS, File interface, File NIS, NFS server, SMB Server and service config. It also allows gathering high level info from the array. The options available for each are list, show, create, modify and delete. These tasks can be executed by running simple playbooks written in yaml syntax. The modules are written so that all the operations are idempotent, so making multiple identical requests has the same effect as making a single request. ## Table of contents -* [Code of conduct](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/CODE_OF_CONDUCT.md) -* [Maintainer guide](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/MAINTAINER_GUIDE.md) -* [Committer guide](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/COMMITTER_GUIDE.md) -* [Contributing guide](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/CONTRIBUTING.md) -* [Branching strategy](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/BRANCHING.md) -* [List of adopters](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/ADOPTERS.md) -* [Maintainers](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/MAINTAINERS.md) -* [Support](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/SUPPORT.md) +* [Code of conduct](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/CODE_OF_CONDUCT.md) +* [Maintainer guide](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/MAINTAINER_GUIDE.md) +* [Committer guide](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/COMMITTER_GUIDE.md) +* [Contributing guide](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/CONTRIBUTING.md) +* [Branching strategy](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/BRANCHING.md) +* [List of adopters](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/ADOPTERS.md) +* [Maintainers](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/MAINTAINERS.md) +* [Support](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/SUPPORT.md) * [License](#license) -* [Security](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/SECURITY.md) +* [Security](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/SECURITY.md) * [Prerequisites](#prerequisites) * [List of Ansible modules for Dell PowerStore](#list-of-ansible-modules-for-dell-powerstore) * [Installation and execution of Ansible modules for Dell PowerStore](#installation-and-execution-of-ansible-modules-for-dell-powerstore) * [Maintenance](#maintenance) ## License -The Ansible collection for PowerStore is released and licensed under the GPL-3.0 license. See [LICENSE](https://github.com/dell/ansible-powerstore/blob/3.2.0/LICENSE) for the full terms. Ansible modules and modules utilities that are part of the Ansible collection for PowerStore are released and licensed under the Apache 2.0 license. See [MODULE-LICENSE](https://github.com/dell/ansible-powerstore/blob/3.2.0/MODULE-LICENSE) for the full terms. +The Ansible collection for PowerStore is released and licensed under the GPL-3.0 license. See [LICENSE](https://github.com/dell/ansible-powerstore/blob/3.3.0/LICENSE) for the full terms. Ansible modules and modules utilities that are part of the Ansible collection for PowerStore are released and licensed under the Apache 2.0 license. See [MODULE-LICENSE](https://github.com/dell/ansible-powerstore/blob/3.3.0/MODULE-LICENSE) for the full terms. ## Prerequisites | **Ansible Modules** | **PowerStore Version** | **SDK version** | **Python version** | **Ansible** | |---------------------|-----------------------|-----------------|--------------------|--------------------------| -| v3.2.0 | 2.9.x
3.2.x
3.5.x
3.6.x | 3.1.0 | 3.6.x
3.9.x
3.10.x
3.11.x | 2.14
2.15
2.16 | +| v3.3.0 | 2.9.x
3.2.x
3.5.x
3.6.x
4.0.x | 3.2.0 | 3.6.x
3.9.x
3.10.x
3.11.x | 2.14
2.15
2.16 | * Please follow PyPowerStore installation instructions on [PyPowerStore Documentation](https://github.com/dell/python-powerstore) @@ -35,49 +35,49 @@ The Ansible collection for PowerStore is released and licensed under the GPL-3.0 The modules are written in such a way that all requests are idempotent and hence fault-tolerant. It essentially means that the result of a successfully performed request is independent of the number of times it is executed. ## List of Ansible Modules for Dell PowerStore -* [Volume module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/volume.rst) -* [Volume group module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/volumegroup.rst) -* [Host module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/host.rst) -* [Host group module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/hostgroup.rst) -* [Snapshot module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/snapshot.rst) -* [Snapshot rule module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/snapshotrule.rst) -* [Replication rule module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/replicationrule.rst) -* [Replication session module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/replicationsession.rst) -* [Protection policy module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/protectionpolicy.rst) -* [Info module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/info.rst) -* [File system module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/filesystem.rst) -* [NAS server module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/nasserver.rst) -* [SMB share module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/smbshare.rst) -* [Quota module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/quota.rst) -* [File system snapshot module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/filesystem_snapshot.rst) -* [NFS export module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/nfs.rst) -* [Cluster module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/cluster.rst) -* [Network module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/network.rst) -* [Local user module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/local_user.rst) -* [Role module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/role.rst) -* [Job module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/job.rst) -* [Certificate module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/certificate.rst) -* [Remote system module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/remotesystem.rst) -* [Security config module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/security_config.rst) -* [DNS module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/dns.rst) -* [Email module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/email.rst) -* [NTP module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/ntp.rst) -* [Remote support module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/remote_support.rst) -* [Remote support contact module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/remote_support_contact.rst) -* [SMTP config module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/smtp_config.rst) -* [LDAP Account module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/ldap_account.rst) -* [LDAP Domain module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/ldap_domain.rst) -* [vCenter module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/vcenter.rst) -* [Storage container module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/storage_container.rst) -* [File interface module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/file_interface.rst) -* [File DNS module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/file_dns.rst) -* [File NIS module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/file_nis.rst) -* [SMB server module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/smb_server.rst) -* [NFS server module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/nfs_server.rst) -* [Service config module](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/modules/service_config.rst) +* [Volume module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/volume.rst) +* [Volume group module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/volumegroup.rst) +* [Host module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/host.rst) +* [Host group module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/hostgroup.rst) +* [Snapshot module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/snapshot.rst) +* [Snapshot rule module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/snapshotrule.rst) +* [Replication rule module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/replicationrule.rst) +* [Replication session module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/replicationsession.rst) +* [Protection policy module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/protectionpolicy.rst) +* [Info module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/info.rst) +* [File system module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/filesystem.rst) +* [NAS server module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/nasserver.rst) +* [SMB share module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/smbshare.rst) +* [Quota module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/quota.rst) +* [File system snapshot module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/filesystem_snapshot.rst) +* [NFS export module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/nfs.rst) +* [Cluster module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/cluster.rst) +* [Network module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/network.rst) +* [Local user module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/local_user.rst) +* [Role module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/role.rst) +* [Job module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/job.rst) +* [Certificate module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/certificate.rst) +* [Remote system module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/remotesystem.rst) +* [Security config module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/security_config.rst) +* [DNS module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/dns.rst) +* [Email module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/email.rst) +* [NTP module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/ntp.rst) +* [Remote support module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/remote_support.rst) +* [Remote support contact module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/remote_support_contact.rst) +* [SMTP config module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/smtp_config.rst) +* [LDAP Account module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/ldap_account.rst) +* [LDAP Domain module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/ldap_domain.rst) +* [vCenter module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/vcenter.rst) +* [Storage container module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/storage_container.rst) +* [File interface module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/file_interface.rst) +* [File DNS module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/file_dns.rst) +* [File NIS module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/file_nis.rst) +* [SMB server module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/smb_server.rst) +* [NFS server module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/nfs_server.rst) +* [Service config module](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/modules/service_config.rst) ## Installation and execution of Ansible modules for Dell PowerStore -The installation and execution steps of Ansible modules for Dell PowerStore can be found [here](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/INSTALLATION.md) +The installation and execution steps of Ansible modules for Dell PowerStore can be found [here](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/INSTALLATION.md) ## Maintenance Ansible Modules for Dell Technologies PowerStore deprecation cycle is aligned with [Ansible](https://docs.ansible.com/ansible/latest/dev_guide/module_lifecycle.html). \ No newline at end of file diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 75c684c..06c834a 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -248,3 +248,8 @@ releases: minor_changes: - Updated and verified to support PyPowerStore SDK version 3.1.0 release_date: '2024-02-29' + 3.3.0: + changes: + minor_changes: + - Added the support for PowerStore version 4.0.0.0 (Victory Release). + release_date: '2024-04-30' diff --git a/codecov.yml b/codecov.yml index ebb28d8..9a6e74a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,3 @@ +--- fixes: - - "/ansible_collections/dellemc/powerstore/::" + - "/ansible_collections/dellemc/powerstore/::" diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index b813d7b..9397305 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -10,7 +10,7 @@ You may obtain a copy of the License at # How to contribute -Become one of the contributors to this project! We thrive to build a welcoming and open community for anyone who wants to use the project or contribute to it. There are just a few small guidelines you need to follow. To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/CODE_OF_CONDUCT.md). +Become one of the contributors to this project! We thrive to build a welcoming and open community for anyone who wants to use the project or contribute to it. There are just a few small guidelines you need to follow. To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/CODE_OF_CONDUCT.md). ## Table of contents @@ -76,7 +76,7 @@ Triage helps ensure that issues resolve quickly by: If you don't have the knowledge or time to code, consider helping with _issue triage_. The Ansible modules for Dell PowerStore community will thank you for saving them time by spending some of yours. -Read more about the ways you can [Triage issues](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/ISSUE_TRIAGE.md). +Read more about the ways you can [Triage issues](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/ISSUE_TRIAGE.md). ## Your first contribution @@ -89,7 +89,7 @@ When you're ready to contribute, it's time to create a pull request. ## Branching -* [Branching Strategy for Ansible modules for Dell PowerStore](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/BRANCHING.md) +* [Branching Strategy for Ansible modules for Dell PowerStore](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/BRANCHING.md) ## Signing your commits @@ -144,7 +144,7 @@ Make sure that the title for your pull request uses the same format as the subje ### Quality gates for pull requests -GitHub Actions are used to enforce quality gates when a pull request is created or when any commit is made to the pull request. These GitHub Actions enforce our minimum code quality requirement for any code that get checked into the repository. If any of the quality gates fail, it is expected that the contributor will look into the check log, understand the problem and resolve the issue. If help is needed, please feel free to reach out the maintainers of the project for [support](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/SUPPORT.md). +GitHub Actions are used to enforce quality gates when a pull request is created or when any commit is made to the pull request. These GitHub Actions enforce our minimum code quality requirement for any code that get checked into the repository. If any of the quality gates fail, it is expected that the contributor will look into the check log, understand the problem and resolve the issue. If help is needed, please feel free to reach out the maintainers of the project for [support](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/SUPPORT.md). #### Code sanitization diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index a90b40e..4bc24ee 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -41,7 +41,7 @@ You may obtain a copy of the License at * Download the latest tar build from any of the available distribution channel [Ansible Galaxy](https://galaxy.ansible.com/dellemc/powerstore) /[Automation Hub](https://console.redhat.com/ansible/automation-hub/repo/published/dellemc/powerstore) and use this command to install the collection anywhere in your system: - ansible-galaxy collection install dellemc-powerstore-3.2.0.tar.gz -p + ansible-galaxy collection install dellemc-powerstore-3.3.0.tar.gz -p * Set the environment variable: @@ -68,7 +68,7 @@ You may obtain a copy of the License at ## Ansible modules execution -The Ansible server must be configured with Python library for PowerStore to run the Ansible playbooks. The [Documents](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/) provide information on different Ansible modules along with their functions and syntax. The parameters table in the Product Guide provides information on various parameters which needs to be configured before running the modules. +The Ansible server must be configured with Python library for PowerStore to run the Ansible playbooks. The [Documents](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/) provide information on different Ansible modules along with their functions and syntax. The parameters table in the Product Guide provides information on various parameters which needs to be configured before running the modules. ## SSL certificate validation diff --git a/docs/ISSUE_TRIAGE.md b/docs/ISSUE_TRIAGE.md index 0dca786..c25ec19 100644 --- a/docs/ISSUE_TRIAGE.md +++ b/docs/ISSUE_TRIAGE.md @@ -43,7 +43,7 @@ Should explain what happened, what was expected and how to reproduce it together - Ansible Version: [e.g. 2.14] - Python Version [e.g. 3.11] - - Ansible modules for Dell PowerStore Version: [e.g. 3.2.0] + - Ansible modules for Dell PowerStore Version: [e.g. 3.3.0] - PowerStore SDK version: [e.g. PyPowerStore 3.1.0] - Any other additional information... diff --git a/docs/MAINTAINER_GUIDE.md b/docs/MAINTAINER_GUIDE.md index a36eade..5667d42 100644 --- a/docs/MAINTAINER_GUIDE.md +++ b/docs/MAINTAINER_GUIDE.md @@ -27,7 +27,7 @@ If a candidate is approved, a Maintainer contacts the candidate to invite them t ## Maintainer policies * Lead by example -* Follow the [Code of Conduct](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/CODE_OF_CONDUCT.md) and the guidelines in the [Contributing](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/CONTRIBUTING.md) and [Committer](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/COMMITTER_GUIDE.md) guides +* Follow the [Code of Conduct](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/CODE_OF_CONDUCT.md) and the guidelines in the [Contributing](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/CONTRIBUTING.md) and [Committer](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/COMMITTER_GUIDE.md) guides * Promote a friendly and collaborative environment within our community * Be actively engaged in discussions, answering questions, updating defects, and reviewing pull requests * Criticize code, not people. Ideally, tell the contributor a better way to do what they need. diff --git a/docs/Release Notes.md b/docs/Release Notes.md index cfa7722..70b8e76 100644 --- a/docs/Release Notes.md +++ b/docs/Release Notes.md @@ -1,6 +1,6 @@ **Ansible Modules for Dell Technologies PowerStore** ========================================= -### Release Notes 3.2.0 +### Release Notes 3.3.0 > © 2024 Dell Inc. or its subsidiaries. All rights reserved. Dell, > and other trademarks are trademarks of Dell Inc. or its @@ -28,7 +28,7 @@ Table 1. Revision history | Revision | Date | Description | |----------|--------------|-----------------------------------------------------------| -| 01 | February 2024 | Current release of Ansible Modules for Dell PowerStore 3.2.0 | +| 01 | April 2024 | Current release of Ansible Modules for Dell PowerStore 3.3.0 | Product Description ------------------- @@ -38,6 +38,7 @@ New features & enhancements --------------------------- Along with the previous release deliverables, this release supports these features: +- Added support for PowerStore 4.0.0.0 - Added support for PowerStore 3.6.x.x. - Added support for creating, getting details, modifying and deleting a file interface. @@ -70,11 +71,11 @@ Limitations Distribution ---------------- The software package is available for download from the [Ansible Modules -for PowerStore GitHub](https://github.com/dell/ansible-powerstore/tree/3.2.0) page. +for PowerStore GitHub](https://github.com/dell/ansible-powerstore/tree/3.3.0) page. Documentation ------------- -The documentation is available on [Ansible Modules for PowerStore GitHub](https://github.com/dell/ansible-powerstore/tree/3.2.0/docs) +The documentation is available on [Ansible Modules for PowerStore GitHub](https://github.com/dell/ansible-powerstore/tree/3.3.0/docs) page. It includes these: - README - Release Notes (this document) diff --git a/docs/SECURITY.md b/docs/SECURITY.md index f84b1de..d93a81f 100644 --- a/docs/SECURITY.md +++ b/docs/SECURITY.md @@ -12,7 +12,7 @@ You may obtain a copy of the License at The Ansible modules for Dell PowerStore repository are inspected for security vulnerabilities via blackduck scans and static code analysis. -In addition to this, there are various security checks that get executed against a branch when a pull request is created/updated. Please refer to [pull request](https://github.com/dell/ansible-powerstore/blob/3.2.0/docs/CONTRIBUTING.md#Pull-requests) for more information. +In addition to this, there are various security checks that get executed against a branch when a pull request is created/updated. Please refer to [pull request](https://github.com/dell/ansible-powerstore/blob/3.3.0/docs/CONTRIBUTING.md#Pull-requests) for more information. ## Reporting a vulnerability diff --git a/docs/modules/certificate.rst b/docs/modules/certificate.rst index 1bbafb1..6965d02 100644 --- a/docs/modules/certificate.rst +++ b/docs/modules/certificate.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/cluster.rst b/docs/modules/cluster.rst index d651763..c1ce4fd 100644 --- a/docs/modules/cluster.rst +++ b/docs/modules/cluster.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/dns.rst b/docs/modules/dns.rst index 0f97dc8..d131db5 100644 --- a/docs/modules/dns.rst +++ b/docs/modules/dns.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/email.rst b/docs/modules/email.rst index 0cf050e..6c0548f 100644 --- a/docs/modules/email.rst +++ b/docs/modules/email.rst @@ -28,7 +28,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/file_dns.rst b/docs/modules/file_dns.rst index a7be561..e186b67 100644 --- a/docs/modules/file_dns.rst +++ b/docs/modules/file_dns.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/file_interface.rst b/docs/modules/file_interface.rst index 3fbf751..9a17c52 100644 --- a/docs/modules/file_interface.rst +++ b/docs/modules/file_interface.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/file_nis.rst b/docs/modules/file_nis.rst index 25cb0ce..dbdbdc3 100644 --- a/docs/modules/file_nis.rst +++ b/docs/modules/file_nis.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/filesystem.rst b/docs/modules/filesystem.rst index d9b2ce2..b595788 100644 --- a/docs/modules/filesystem.rst +++ b/docs/modules/filesystem.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/filesystem_snapshot.rst b/docs/modules/filesystem_snapshot.rst index 5d500d5..53a347a 100644 --- a/docs/modules/filesystem_snapshot.rst +++ b/docs/modules/filesystem_snapshot.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/host.rst b/docs/modules/host.rst index 5f5e5f9..f04dc63 100644 --- a/docs/modules/host.rst +++ b/docs/modules/host.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/hostgroup.rst b/docs/modules/hostgroup.rst index 466d5b5..b7f15d2 100644 --- a/docs/modules/hostgroup.rst +++ b/docs/modules/hostgroup.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/info.rst b/docs/modules/info.rst index 0b8e612..70bfd68 100644 --- a/docs/modules/info.rst +++ b/docs/modules/info.rst @@ -36,7 +36,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/job.rst b/docs/modules/job.rst index 0cf92fb..b96995d 100644 --- a/docs/modules/job.rst +++ b/docs/modules/job.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/ldap_account.rst b/docs/modules/ldap_account.rst index 07b56d2..677a85e 100644 --- a/docs/modules/ldap_account.rst +++ b/docs/modules/ldap_account.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/ldap_domain.rst b/docs/modules/ldap_domain.rst index 8bc758e..69cf29d 100644 --- a/docs/modules/ldap_domain.rst +++ b/docs/modules/ldap_domain.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/local_user.rst b/docs/modules/local_user.rst index ad77ff4..ba8dd78 100644 --- a/docs/modules/local_user.rst +++ b/docs/modules/local_user.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/nasserver.rst b/docs/modules/nasserver.rst index 511e736..8639bcb 100644 --- a/docs/modules/nasserver.rst +++ b/docs/modules/nasserver.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/network.rst b/docs/modules/network.rst index 744a32c..a5ec469 100644 --- a/docs/modules/network.rst +++ b/docs/modules/network.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/nfs.rst b/docs/modules/nfs.rst index 3732013..e40df2a 100644 --- a/docs/modules/nfs.rst +++ b/docs/modules/nfs.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/nfs_server.rst b/docs/modules/nfs_server.rst index a6ddfc9..ded1c58 100644 --- a/docs/modules/nfs_server.rst +++ b/docs/modules/nfs_server.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/ntp.rst b/docs/modules/ntp.rst index 110fe2b..4e5667d 100644 --- a/docs/modules/ntp.rst +++ b/docs/modules/ntp.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/protectionpolicy.rst b/docs/modules/protectionpolicy.rst index 41dba9e..ff773bf 100644 --- a/docs/modules/protectionpolicy.rst +++ b/docs/modules/protectionpolicy.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/quota.rst b/docs/modules/quota.rst index ecee75c..f7cbe25 100644 --- a/docs/modules/quota.rst +++ b/docs/modules/quota.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/remote_support.rst b/docs/modules/remote_support.rst index 872b357..08e1de0 100644 --- a/docs/modules/remote_support.rst +++ b/docs/modules/remote_support.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/remote_support_contact.rst b/docs/modules/remote_support_contact.rst index 3c89ed2..0c2ea43 100644 --- a/docs/modules/remote_support_contact.rst +++ b/docs/modules/remote_support_contact.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/remotesystem.rst b/docs/modules/remotesystem.rst index 0dc8bf5..0617d1d 100644 --- a/docs/modules/remotesystem.rst +++ b/docs/modules/remotesystem.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/replicationrule.rst b/docs/modules/replicationrule.rst index 0f336ee..38ba307 100644 --- a/docs/modules/replicationrule.rst +++ b/docs/modules/replicationrule.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/replicationsession.rst b/docs/modules/replicationsession.rst index 4900712..15167b4 100644 --- a/docs/modules/replicationsession.rst +++ b/docs/modules/replicationsession.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/role.rst b/docs/modules/role.rst index 7c6703b..93022f2 100644 --- a/docs/modules/role.rst +++ b/docs/modules/role.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/security_config.rst b/docs/modules/security_config.rst index 3f00158..38fc8cb 100644 --- a/docs/modules/security_config.rst +++ b/docs/modules/security_config.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. @@ -88,6 +88,7 @@ Notes - Creation and deletion of security configs is not supported by Ansible modules. - Modification of protocol mode is only supported for PowerStore v2.0.0.0 and above. - The *check_mode* is not supported. + - Parameter TLSv1_1 is supported for protocol_mode for PowerStore v3.0.0.0 and above. - The modules present in this collection named as 'dellemc.powerstore' are built to support the Dell PowerStore storage platform. diff --git a/docs/modules/service_config.rst b/docs/modules/service_config.rst index f9aa757..250e64c 100644 --- a/docs/modules/service_config.rst +++ b/docs/modules/service_config.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/smb_server.rst b/docs/modules/smb_server.rst index 2af47a7..f35ff05 100644 --- a/docs/modules/smb_server.rst +++ b/docs/modules/smb_server.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/smbshare.rst b/docs/modules/smbshare.rst index 25c126e..95318fe 100644 --- a/docs/modules/smbshare.rst +++ b/docs/modules/smbshare.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/smtp_config.rst b/docs/modules/smtp_config.rst index 3568bad..75d7c7e 100644 --- a/docs/modules/smtp_config.rst +++ b/docs/modules/smtp_config.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/snapshot.rst b/docs/modules/snapshot.rst index ed1638f..a4df02a 100644 --- a/docs/modules/snapshot.rst +++ b/docs/modules/snapshot.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/snapshotrule.rst b/docs/modules/snapshotrule.rst index 97c3589..d07f308 100644 --- a/docs/modules/snapshotrule.rst +++ b/docs/modules/snapshotrule.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/storage_container.rst b/docs/modules/storage_container.rst index 8d51d36..9713fce 100644 --- a/docs/modules/storage_container.rst +++ b/docs/modules/storage_container.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/vcenter.rst b/docs/modules/vcenter.rst index 3b3ba5d..02f5430 100644 --- a/docs/modules/vcenter.rst +++ b/docs/modules/vcenter.rst @@ -22,7 +22,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/docs/modules/volume.rst b/docs/modules/volume.rst index 2f3c025..51a5fe8 100644 --- a/docs/modules/volume.rst +++ b/docs/modules/volume.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. @@ -308,6 +308,7 @@ Notes - A volume that is attached to a host/host group, or that is part of a volume group cannot be deleted. - If volume in metro session, volume can only be modified, refreshed and restored when session is in the pause state. - The *Check_mode* is not supported. + - Parameter performance_policy and host_group details are not in the return values for PowerStore 4.0.0.0. - The modules present in this collection named as 'dellemc.powerstore' are built to support the Dell PowerStore storage platform. diff --git a/docs/modules/volumegroup.rst b/docs/modules/volumegroup.rst index 1c9925e..ee8ef49 100644 --- a/docs/modules/volumegroup.rst +++ b/docs/modules/volumegroup.rst @@ -24,7 +24,7 @@ The below requirements are needed on the host that executes this module. - A Dell PowerStore storage system version 3.0.0.0 or later. - Ansible-core 2.14 or later. -- PyPowerStore 3.1.0. +- PyPowerStore 3.2.0. - Python 3.9, 3.10 or 3.11. diff --git a/galaxy.yml b/galaxy.yml index c0126f3..e95b5a0 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -9,7 +9,7 @@ namespace: dellemc name: powerstore # The version of the collection. Must be compatible with semantic versioning -version: 3.2.0 +version: 3.3.0 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md @@ -51,13 +51,13 @@ tags: [storage] dependencies: {} # The URL of the originating SCM repository -repository: https://github.com/dell/ansible-powerstore/tree/3.1.0 +repository: https://github.com/dell/ansible-powerstore/tree/3.3.0 # The URL to any online docs -documentation: https://github.com/dell/ansible-powerstore/tree/3.1.0/docs +documentation: https://github.com/dell/ansible-powerstore/tree/3.3.0/docs # The URL to the homepage of the collection/project -homepage: https://github.com/dell/ansible-powerstore/tree/3.1.0 +homepage: https://github.com/dell/ansible-powerstore/tree/3.3.0 # The URL to the collection issue tracker issues: https://www.dell.com/community/Automation/bd-p/Automation diff --git a/plugins/module_utils/storage/dell/utils.py b/plugins/module_utils/storage/dell/utils.py index 573b96b..245cc3d 100644 --- a/plugins/module_utils/storage/dell/utils.py +++ b/plugins/module_utils/storage/dell/utils.py @@ -62,7 +62,7 @@ def py4ps_version_check(): " please install the required" \ " package" else: - min_ver = '3.1.0' + min_ver = '3.2.0' curr_version = PyPowerStore.__version__ unsupported_version_message = "PyPowerStore {0} is not supported " \ "by this module. Minimum supported" \ diff --git a/plugins/modules/certificate.py b/plugins/modules/certificate.py index 2b85ca3..45a01ab 100644 --- a/plugins/modules/certificate.py +++ b/plugins/modules/certificate.py @@ -262,7 +262,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreCertificate(object): diff --git a/plugins/modules/cluster.py b/plugins/modules/cluster.py index b590a48..f1393e4 100644 --- a/plugins/modules/cluster.py +++ b/plugins/modules/cluster.py @@ -627,7 +627,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreCluster(object): diff --git a/plugins/modules/dns.py b/plugins/modules/dns.py index a649597..06e0532 100644 --- a/plugins/modules/dns.py +++ b/plugins/modules/dns.py @@ -127,7 +127,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreDns(object): diff --git a/plugins/modules/email.py b/plugins/modules/email.py index 4aca232..5bb5260 100644 --- a/plugins/modules/email.py +++ b/plugins/modules/email.py @@ -205,7 +205,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreEmail(object): diff --git a/plugins/modules/file_dns.py b/plugins/modules/file_dns.py index f85ead4..1e4221b 100644 --- a/plugins/modules/file_dns.py +++ b/plugins/modules/file_dns.py @@ -184,7 +184,7 @@ LOG = utils.get_logger('file_dns') # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreFileDNS(PowerStoreBase): diff --git a/plugins/modules/file_interface.py b/plugins/modules/file_interface.py index 46a3d78..17212fa 100644 --- a/plugins/modules/file_interface.py +++ b/plugins/modules/file_interface.py @@ -217,7 +217,7 @@ LOG = utils.get_logger('file_interface') # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreFileInterface(PowerStoreBase): diff --git a/plugins/modules/file_nis.py b/plugins/modules/file_nis.py index 80814a1..02373ad 100644 --- a/plugins/modules/file_nis.py +++ b/plugins/modules/file_nis.py @@ -170,7 +170,7 @@ LOG = utils.get_logger('file_nis') # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreFileNIS(PowerStoreBase): diff --git a/plugins/modules/filesystem.py b/plugins/modules/filesystem.py index 3659b06..ab56aa1 100644 --- a/plugins/modules/filesystem.py +++ b/plugins/modules/filesystem.py @@ -739,7 +739,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreFileSystem(object): diff --git a/plugins/modules/filesystem_snapshot.py b/plugins/modules/filesystem_snapshot.py index 55fc65a..4f0029f 100644 --- a/plugins/modules/filesystem_snapshot.py +++ b/plugins/modules/filesystem_snapshot.py @@ -253,7 +253,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreFilesystemSnapshot(object): diff --git a/plugins/modules/host.py b/plugins/modules/host.py index 0ec728b..47a4c54 100644 --- a/plugins/modules/host.py +++ b/plugins/modules/host.py @@ -373,7 +373,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' # DO NOT CHANGE BELOW PORT_TYPES SEQUENCE AS ITS USED IN SCRIPT USING INDEX PORT_TYPES = ["iSCSI", "FC", "NVMe"] diff --git a/plugins/modules/hostgroup.py b/plugins/modules/hostgroup.py index 5c6cae2..434205f 100644 --- a/plugins/modules/hostgroup.py +++ b/plugins/modules/hostgroup.py @@ -224,7 +224,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreHostgroup(object): diff --git a/plugins/modules/info.py b/plugins/modules/info.py index e25dbbf..e49f007 100644 --- a/plugins/modules/info.py +++ b/plugins/modules/info.py @@ -1824,7 +1824,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreInfo(object): diff --git a/plugins/modules/job.py b/plugins/modules/job.py index 90b317a..8613a73 100644 --- a/plugins/modules/job.py +++ b/plugins/modules/job.py @@ -174,7 +174,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreJob(object): diff --git a/plugins/modules/ldap_account.py b/plugins/modules/ldap_account.py index 91ff14c..aa325d6 100644 --- a/plugins/modules/ldap_account.py +++ b/plugins/modules/ldap_account.py @@ -173,7 +173,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreLDAPAccount(object): diff --git a/plugins/modules/ldap_domain.py b/plugins/modules/ldap_domain.py index d0c7fcc..a955da6 100644 --- a/plugins/modules/ldap_domain.py +++ b/plugins/modules/ldap_domain.py @@ -354,7 +354,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreLDAPDomain(object): diff --git a/plugins/modules/local_user.py b/plugins/modules/local_user.py index e682c2b..634e9e3 100644 --- a/plugins/modules/local_user.py +++ b/plugins/modules/local_user.py @@ -185,7 +185,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreLocalUser(object): diff --git a/plugins/modules/nasserver.py b/plugins/modules/nasserver.py index f332a8a..cb50e41 100644 --- a/plugins/modules/nasserver.py +++ b/plugins/modules/nasserver.py @@ -336,7 +336,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreNasServer(object): diff --git a/plugins/modules/network.py b/plugins/modules/network.py index d5e851f..746ac18 100644 --- a/plugins/modules/network.py +++ b/plugins/modules/network.py @@ -498,7 +498,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreNetwork(object): diff --git a/plugins/modules/nfs.py b/plugins/modules/nfs.py index 5249c97..0240020 100644 --- a/plugins/modules/nfs.py +++ b/plugins/modules/nfs.py @@ -380,7 +380,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreNfsExport(object): diff --git a/plugins/modules/nfs_server.py b/plugins/modules/nfs_server.py index 89d45e0..71ededf 100644 --- a/plugins/modules/nfs_server.py +++ b/plugins/modules/nfs_server.py @@ -210,7 +210,7 @@ LOG = utils.get_logger('nfs_server') # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreNFSServer(PowerStoreBase): diff --git a/plugins/modules/ntp.py b/plugins/modules/ntp.py index e58f5fa..bcb2938 100644 --- a/plugins/modules/ntp.py +++ b/plugins/modules/ntp.py @@ -128,7 +128,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreNtp(object): diff --git a/plugins/modules/protectionpolicy.py b/plugins/modules/protectionpolicy.py index ae21763..81fbdbf 100644 --- a/plugins/modules/protectionpolicy.py +++ b/plugins/modules/protectionpolicy.py @@ -239,7 +239,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreProtectionpolicy(object): diff --git a/plugins/modules/quota.py b/plugins/modules/quota.py index 580f6c4..8312a71 100644 --- a/plugins/modules/quota.py +++ b/plugins/modules/quota.py @@ -363,7 +363,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreQuota(object): diff --git a/plugins/modules/remote_support.py b/plugins/modules/remote_support.py index f19d127..88a0b1a 100644 --- a/plugins/modules/remote_support.py +++ b/plugins/modules/remote_support.py @@ -356,7 +356,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreRemoteSupport(object): diff --git a/plugins/modules/remote_support_contact.py b/plugins/modules/remote_support_contact.py index aec8403..d9f70e7 100644 --- a/plugins/modules/remote_support_contact.py +++ b/plugins/modules/remote_support_contact.py @@ -136,7 +136,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreRemoteSupportContact(object): diff --git a/plugins/modules/remotesystem.py b/plugins/modules/remotesystem.py index 2822d12..1a3ca21 100644 --- a/plugins/modules/remotesystem.py +++ b/plugins/modules/remotesystem.py @@ -308,7 +308,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreRemoteSystem(object): diff --git a/plugins/modules/replicationrule.py b/plugins/modules/replicationrule.py index 9d7fce2..64376a6 100644 --- a/plugins/modules/replicationrule.py +++ b/plugins/modules/replicationrule.py @@ -197,7 +197,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreReplicationRule(object): diff --git a/plugins/modules/replicationsession.py b/plugins/modules/replicationsession.py index cdc6208..52b33bd 100644 --- a/plugins/modules/replicationsession.py +++ b/plugins/modules/replicationsession.py @@ -230,7 +230,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' """ =============================================================================== Idempotency table for the replication session ansible module on the basis of diff --git a/plugins/modules/role.py b/plugins/modules/role.py index aa07053..d1239c5 100644 --- a/plugins/modules/role.py +++ b/plugins/modules/role.py @@ -113,7 +113,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreRole(object): diff --git a/plugins/modules/security_config.py b/plugins/modules/security_config.py index 0909f42..3b7c8a2 100644 --- a/plugins/modules/security_config.py +++ b/plugins/modules/security_config.py @@ -48,6 +48,8 @@ - Modification of protocol mode is only supported for PowerStore v2.0.0.0 and above. - The I(check_mode) is not supported. +- Only C(TLSv1_1) is supported for I(protocol_mode) for PowerStore v3.0.0.0 and + above. ''' EXAMPLES = r''' @@ -116,7 +118,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreSecurityConfig(object): diff --git a/plugins/modules/service_config.py b/plugins/modules/service_config.py index 868d471..7dd893b 100644 --- a/plugins/modules/service_config.py +++ b/plugins/modules/service_config.py @@ -115,7 +115,7 @@ LOG = utils.get_logger('service_config') # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class ServiceConfigs(PowerStoreBase): diff --git a/plugins/modules/smb_server.py b/plugins/modules/smb_server.py index 0a98cd1..5bdba6b 100644 --- a/plugins/modules/smb_server.py +++ b/plugins/modules/smb_server.py @@ -195,7 +195,7 @@ LOG = utils.get_logger('smb_server') # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreSMBServer(PowerStoreBase): diff --git a/plugins/modules/smbshare.py b/plugins/modules/smbshare.py index c365ba3..2b203e9 100644 --- a/plugins/modules/smbshare.py +++ b/plugins/modules/smbshare.py @@ -311,7 +311,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreSMBShare(object): diff --git a/plugins/modules/smtp_config.py b/plugins/modules/smtp_config.py index d1a3548..1b9539e 100644 --- a/plugins/modules/smtp_config.py +++ b/plugins/modules/smtp_config.py @@ -138,7 +138,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreSmtpConfig(object): diff --git a/plugins/modules/snapshot.py b/plugins/modules/snapshot.py index 0e1e3af..82f0273 100644 --- a/plugins/modules/snapshot.py +++ b/plugins/modules/snapshot.py @@ -344,7 +344,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreSnapshot(object): diff --git a/plugins/modules/snapshotrule.py b/plugins/modules/snapshotrule.py index 3d9be6e..6636ad3 100644 --- a/plugins/modules/snapshotrule.py +++ b/plugins/modules/snapshotrule.py @@ -253,7 +253,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreSnapshotrule(object): diff --git a/plugins/modules/storage_container.py b/plugins/modules/storage_container.py index 4f367f0..2239281 100644 --- a/plugins/modules/storage_container.py +++ b/plugins/modules/storage_container.py @@ -361,7 +361,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreStorageContainer(object): diff --git a/plugins/modules/vcenter.py b/plugins/modules/vcenter.py index 09ef30c..ed4b0a5 100644 --- a/plugins/modules/vcenter.py +++ b/plugins/modules/vcenter.py @@ -215,7 +215,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerstoreVCenter(object): diff --git a/plugins/modules/volume.py b/plugins/modules/volume.py index aed21cc..798892c 100644 --- a/plugins/modules/volume.py +++ b/plugins/modules/volume.py @@ -273,6 +273,8 @@ - If volume in metro session, volume can only be modified, refreshed and restored when session is in the pause state. - The I(Check_mode) is not supported. +- I(performance_policy) and I(host_group) details are not in the return values for + PowerStore 4.0.0.0. ''' EXAMPLES = r''' @@ -631,7 +633,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreVolume(object): @@ -842,27 +844,27 @@ def map_unmap_volume_to_host(self, vol, host, mapping_state): self.module.fail_json(msg=error_msg, **utils.failure_codes(e)) return False - def map_unmap_volume_to_hostgroup(self, vol, hostgroup, mapping_state): + def map_unmap_volume_to_hostgroup(self, vol, hostgroup_details, mapping_state): host_group_identifier = self.module.params['hostgroup'] - current_hostgroups = vol['host_group'] - current_hostgroup_ids = [] - for hostgroup_t in current_hostgroups: - current_hostgroup_ids.append(hostgroup_t['id']) - - if mapping_state == 'mapped' and hostgroup in current_hostgroup_ids: - LOG.info('Volume %s is already mapped to hostgroup %s', - vol['name'], host_group_identifier) - return False + current_volumes = hostgroup_details['mapped_host_groups'] + current_volume_ids = [] + for volume in range(len(current_volumes)): + current_volume_ids.append(hostgroup_details['mapped_host_groups'][volume]['volume_id']) + + if hostgroup_details['mapped_host_groups'] != []: + if mapping_state == 'mapped' and vol['id'] in current_volume_ids: + LOG.info('Volume %s is already mapped to hostgroup %s', + vol['name'], host_group_identifier) + return False - if mapping_state == 'mapped' and hostgroup not in\ - current_hostgroup_ids: + if mapping_state == 'mapped' and vol['id'] not in current_volume_ids: hlu = self.module.params['hlu'] LOG.info('Mapping volume %s to hostgroup %s with HLU %s', vol['name'], host_group_identifier, hlu) try: self.provisioning.map_volume_to_host_group( volume_id=vol['id'], - host_group_id=hostgroup, + host_group_id=hostgroup_details['id'], logical_unit_number=hlu) return True except Exception as e: @@ -873,18 +875,17 @@ def map_unmap_volume_to_hostgroup(self, vol, hostgroup, mapping_state): LOG.error(error_msg) self.module.fail_json(msg=error_msg, **utils.failure_codes(e)) - if mapping_state == 'unmapped' and hostgroup not in\ - current_hostgroup_ids: + if mapping_state == 'unmapped' and vol['id'] not in current_volume_ids: LOG.info('Volume %s is not mapped to hostgroup %s', vol['name'], host_group_identifier) return False - if mapping_state == 'unmapped' and hostgroup in current_hostgroup_ids: + if mapping_state == 'unmapped' and vol['id'] in current_volume_ids: LOG.info('Unmapping volume %s from hostgroup %s', vol['name'], host_group_identifier) try: self.provisioning.unmap_volume_from_host_group( - volume_id=vol['id'], host_group_id=hostgroup) + volume_id=vol['id'], host_group_id=hostgroup_details['id']) return True except Exception as e: error_msg = ( @@ -926,7 +927,7 @@ def validate_clone_details(self, clone_details): if clone_details['host'] is not None: clone_details['host_id'] = self.get_host_id_by_name(clone_details['host']) if clone_details['host_group'] is not None: - clone_details['host_group_id'] = self.get_host_group_id_by_name(clone_details['host_group']) + clone_details['host_group_id'] = self.get_host_group_id_by_name(clone_details['host_group'])['id'] if clone_details['host_id'] is None and clone_details['host_group_id'] is None and clone_details['logical_unit_number'] is not None: errormsg = "Either of host identifier or host group identifier is required along with logical_unit_number." LOG.error(errormsg) @@ -1187,8 +1188,11 @@ def perform_module_operation(self): description = self.module.params['description'] mapping_state = self.module.params['mapping_state'] host = self.get_host_id_by_name(self.module.params['host']) - hostgroup = self.get_host_group_id_by_name( + hostgroup_details = self.get_host_group_id_by_name( self.module.params['hostgroup']) + hostgroup = None + if hostgroup_details: + hostgroup = hostgroup_details['id'] hlu = self.module.params['hlu'] clone_volume = self.module.params['clone_volume'] source_volume = self.module.params['source_volume'] @@ -1375,7 +1379,7 @@ def perform_module_operation(self): volume, host, mapping_state) or changed if hostgroup: changed = self.map_unmap_volume_to_hostgroup( - volume, hostgroup, mapping_state) or changed + volume, hostgroup_details, mapping_state) or changed if state == 'present' and clone_volume is not None: changed = self.clone_volume(vol_id, clone_volume) @@ -1587,18 +1591,18 @@ def get_host_group_id_by_name(self, host_group_name): # Get the host group details using name host_group_info = self.provisioning.\ get_host_group_by_name(host_group_name) - if host_group_info: if len(host_group_info) > 1: error_msg = 'Multiple host groups by the same name ' \ 'found' LOG.error(error_msg) self.module.fail_json(msg=error_msg) - return host_group_info[0]['id'] + return host_group_info[0] else: # Get the host group details using id - if self.provisioning.get_host_group_details(host_group_name): - return host_group_name + host_group_info = self.provisioning.get_host_group_details(host_group_name) + if host_group_info: + return host_group_info error_msg = ("host group {0} not found".format(host_group_name)) LOG.error(error_msg) diff --git a/plugins/modules/volumegroup.py b/plugins/modules/volumegroup.py index 096ec33..9317f50 100644 --- a/plugins/modules/volumegroup.py +++ b/plugins/modules/volumegroup.py @@ -398,7 +398,7 @@ VERSION_ERROR = py4ps_version['unsupported_version_message'] # Application type -APPLICATION_TYPE = 'Ansible/3.2.0' +APPLICATION_TYPE = 'Ansible/3.3.0' class PowerStoreVolumeGroup(object): diff --git a/requirements.txt b/requirements.txt index 2cbca82..158e3d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ PyPowerStore urllib3>=1.26.7 + diff --git a/tests/sanity/ignore-2.18.txt b/tests/sanity/ignore-2.18.txt new file mode 100644 index 0000000..3e505ee --- /dev/null +++ b/tests/sanity/ignore-2.18.txt @@ -0,0 +1,40 @@ +plugins/modules/certificate.py validate-modules:missing-gplv3-license +plugins/modules/cluster.py validate-modules:missing-gplv3-license +plugins/modules/dns.py validate-modules:missing-gplv3-license +plugins/modules/email.py validate-modules:missing-gplv3-license +plugins/modules/filesystem.py validate-modules:missing-gplv3-license +plugins/modules/filesystem_snapshot.py validate-modules:missing-gplv3-license +plugins/modules/host.py validate-modules:missing-gplv3-license +plugins/modules/hostgroup.py validate-modules:missing-gplv3-license +plugins/modules/info.py validate-modules:missing-gplv3-license +plugins/modules/job.py validate-modules:missing-gplv3-license +plugins/modules/ldap_account.py validate-modules:missing-gplv3-license +plugins/modules/local_user.py validate-modules:missing-gplv3-license +plugins/modules/nasserver.py validate-modules:missing-gplv3-license +plugins/modules/network.py validate-modules:missing-gplv3-license +plugins/modules/nfs.py validate-modules:missing-gplv3-license +plugins/modules/ntp.py validate-modules:missing-gplv3-license +plugins/modules/protectionpolicy.py validate-modules:missing-gplv3-license +plugins/modules/quota.py validate-modules:missing-gplv3-license +plugins/modules/remotesystem.py validate-modules:missing-gplv3-license +plugins/modules/remote_support_contact.py validate-modules:missing-gplv3-license +plugins/modules/remote_support.py validate-modules:missing-gplv3-license +plugins/modules/replicationrule.py validate-modules:missing-gplv3-license +plugins/modules/replicationsession.py validate-modules:missing-gplv3-license +plugins/modules/role.py validate-modules:missing-gplv3-license +plugins/modules/security_config.py validate-modules:missing-gplv3-license +plugins/modules/smbshare.py validate-modules:missing-gplv3-license +plugins/modules/smtp_config.py validate-modules:missing-gplv3-license +plugins/modules/snapshot.py validate-modules:missing-gplv3-license +plugins/modules/snapshotrule.py validate-modules:missing-gplv3-license +plugins/modules/storage_container.py validate-modules:missing-gplv3-license +plugins/modules/volume.py validate-modules:missing-gplv3-license +plugins/modules/volumegroup.py validate-modules:missing-gplv3-license +plugins/modules/ldap_domain.py validate-modules:missing-gplv3-license +plugins/modules/vcenter.py validate-modules:missing-gplv3-license +plugins/modules/file_interface.py validate-modules:missing-gplv3-license +plugins/modules/file_dns.py validate-modules:missing-gplv3-license +plugins/modules/file_nis.py validate-modules:missing-gplv3-license +plugins/modules/smb_server.py validate-modules:missing-gplv3-license +plugins/modules/nfs_server.py validate-modules:missing-gplv3-license +plugins/modules/service_config.py validate-modules:missing-gplv3-license \ No newline at end of file diff --git a/tests/unit/plugins/module_utils/mock_filesystem_snapshot_api.py b/tests/unit/plugins/module_utils/mock_filesystem_snapshot_api.py index 464bf99..2ab3261 100644 --- a/tests/unit/plugins/module_utils/mock_filesystem_snapshot_api.py +++ b/tests/unit/plugins/module_utils/mock_filesystem_snapshot_api.py @@ -77,96 +77,29 @@ class MockFilesystemSnapshotApi: } ] - CREATE_FS_SNAPSHOT = [ - { - "access_policy": None, - "access_policy_l10n": None, - "access_type": "Protocol", - "access_type_l10n": "Protocol", - "creation_timestamp": create_time, - "creator_type": "User", - "creator_type_l10n": "User", - "default_hard_limit": None, - "default_soft_limit": None, - "description": None, - "expiration_timestamp": expire_time, - "filesystem_type": "Snapshot", - "filesystem_type_l10n": "Snapshot", - "folder_rename_policy": None, - "folder_rename_policy_l10n": None, - "grace_period": None, - "id": "61e49f3f-9b57-e69b-1038-aa02b52a030f", - "is_async_MTime_enabled": False, - "is_modified": False, - "is_quota_enabled": None, - "is_smb_no_notify_enabled": None, - "is_smb_notify_on_access_enabled": None, - "is_smb_notify_on_write_enabled": None, - "is_smb_op_locks_enabled": None, - "is_smb_sync_writes_enabled": None, - "last_refresh_timestamp": None, - "last_writable_timestamp": None, - "locking_policy": None, - "locking_policy_l10n": None, - "name": "Sample_FS_Snapshot_1", - "nas_server": { - "id": "6026056b-5405-0e36-7697-c285b9fa42b7", - "name": "ansible_nas_server_2" - }, - "parent_id": "61e4947b-8992-3db7-2859-aa02b52a0308", - "parent_name": "sample-filesystem", - "protection_policy": None, - "size_total": "214748364800", - "size_used": "1621098496", - "smb_notify_on_change_dir_depth": 0 - } - ] + ERROR_MAP = { + "vet": "Incorrect date format, should be YYYY-MM-DDTHH:MM:SSZ", + "vdr_err1": "Please provide a valid integer as the desired retention between 1 and 744.", + "vdr_err2": "Please provide a valid integer as the desired retention between 1 and 31.", + "nse_err1": "Failed to get details of NAS server nas_server_name with error Please provide valid NAS server details", + "nse_err2": "Failed to get details of NAS server nas_server_name with error", + "nfe_err1": "Failed to get the filesystem sample_filesystem by name with error Filesystem sample_filesystem not found on the array.", + "nfe_err2": "Failed to get the filesystem sample_filesystem by name with error Please provide NAS Server details along with filesystem", + "fs_name_exp": "Filesystem 61e4947b-8992-3db7-2859-aa02b52a0308 not found on the array", + "fs_snap_exp1": "Please provide filesystem or NAS server details along with snapshot name.", + "fs_snap_exp2": "Given filesystem 61e4947b-8992-3db7-2859-aa02b52a0318 does not match with the filesystem of the snapshot.", + "fs_snap_exp3": "Failed to get the filesystem snapshot None with error", + "create_exp1": "Please provide valid snapshot name.", + "create_exp2": "Snapshot with name sample_snapshot is not found on nas_server nas_server. Please provide filesystem details to create a new snapshot.", + "create_exp3": "Failed to create snapshot: sample_snapshot", + "fs_snap_mod_exp1": "Modification of access type is not allowed.", + "mod_fs_snapshot": "Modify operation of filesystem snapshot with name: Name, id: 61e4947b-8992-3db7-2859-aa02b52a0308 failed with error", + "del_fs_snapshot": "Delete operation of filesystem snapshot with name: Name, id: 61e4947b-8992-3db7-2859-aa02b52a0308 failed with error", - MODIFY_FS_SNAPSHOT = [ - { - "access_policy": None, - "access_policy_l10n": None, - "access_type": "Snapshot", - "access_type_l10n": "Snapshot", - "creation_timestamp": create_time, - "creator_type": "User", - "creator_type_l10n": "User", - "default_hard_limit": None, - "default_soft_limit": None, - "description": 'Description', - "expiration_timestamp": expire_time, - "filesystem_type": "Snapshot", - "filesystem_type_l10n": "Snapshot", - "folder_rename_policy": None, - "folder_rename_policy_l10n": None, - "grace_period": None, - "id": "61e49f3f-9b57-e69b-1038-aa02b52a030f", - "is_async_MTime_enabled": False, - "is_modified": False, - "is_quota_enabled": None, - "is_smb_no_notify_enabled": None, - "is_smb_notify_on_access_enabled": None, - "is_smb_notify_on_write_enabled": None, - "is_smb_op_locks_enabled": None, - "is_smb_sync_writes_enabled": None, - "last_refresh_timestamp": None, - "last_writable_timestamp": None, - "locking_policy": None, - "locking_policy_l10n": None, - "name": "Sample_FS_Snapshot", - "nas_server": { - "id": "6026056b-5405-0e36-7697-c285b9fa42b7", - "name": "ansible_nas_server_2" - }, - "parent_id": "61e4947b-8992-3db7-2859-aa02b52a0308", - "parent_name": "sample-filesystem", - "protection_policy": None, - "size_total": "214748364800", - "size_used": "1621098496", - "smb_notify_on_change_dir_depth": 0 - } - ] + } + + MODULE_PATH = "ansible_collections.dellemc.powerstore.plugins.modules.filesystem_snapshot.PowerStoreFilesystemSnapshot" @staticmethod - def get_fs_snapshot_without_nas_failed_msg(): - return "Please provide filesystem or NAS server details along with snapshot name" + def get_error_message(key): + return MockFilesystemSnapshotApi.ERROR_MAP.get(key) diff --git a/tests/unit/plugins/module_utils/mock_security_config_api.py b/tests/unit/plugins/module_utils/mock_security_config_api.py index 4e8927a..4438b40 100644 --- a/tests/unit/plugins/module_utils/mock_security_config_api.py +++ b/tests/unit/plugins/module_utils/mock_security_config_api.py @@ -19,6 +19,17 @@ class MockSecurityConfigApi: 'protocol_mode': None } + ERROR_MAP = { + "scd_exp": "Failed to get the security config using ID 1 with error", + "msc_exp": "Failed to modify security config instance with error", + "pm_exp1": "Security config not found", + "pm_exp2": "Deletion of security config is not allowed", + } + + @staticmethod + def get_error_message(key): + return MockSecurityConfigApi.ERROR_MAP.get(key) + @staticmethod def get_security_config_response(response_type): if response_type == 'module': diff --git a/tests/unit/plugins/module_utils/mock_volume_api.py b/tests/unit/plugins/module_utils/mock_volume_api.py index e89e0f6..36ee371 100644 --- a/tests/unit/plugins/module_utils/mock_volume_api.py +++ b/tests/unit/plugins/module_utils/mock_volume_api.py @@ -125,7 +125,31 @@ class MockVolumeApi: } ], "id": "d0a61806-0992-4e8b-9419-d47ac1ed563f", - "name": "sample_host_group" + "name": "sample_host_group", + "mapped_host_groups": [ + { + "id": "6bff38b9-4895-4f3c-8d1c-406d5b734656", + "volume_id": "ae20eb9a-a482-416e-aaf7-2a3fe7203631" + } + ] + }] + + HG_DETAILS2 = [{ + "description": None, + "hosts": [ + { + "id": "ced80318-b14a-461d-93a7-11b10afaf347", + "name": "sample_host1" + } + ], + "id": "d0a61806-0992-4e8b-9419-d47ac1ed563g", + "name": "sample_host_group_2", + "mapped_host_groups": [ + { + "id": "6bff38b9-4895-4f3c-8d1c-406d5b734656", + "volume_id": "ae20eb9a-a482-416e-aaf7-2a3fe7203630" + } + ] }] VOL_DETAILS1 = [ diff --git a/tests/unit/plugins/modules/test_filesystem_snapshot.py b/tests/unit/plugins/modules/test_filesystem_snapshot.py index 23dba3a..9e35ae2 100644 --- a/tests/unit/plugins/modules/test_filesystem_snapshot.py +++ b/tests/unit/plugins/modules/test_filesystem_snapshot.py @@ -15,137 +15,458 @@ from ansible_collections.dellemc.powerstore.tests.unit.plugins.module_utils.mock_filesystem_snapshot_api import MockFilesystemSnapshotApi from ansible_collections.dellemc.powerstore.tests.unit.plugins.module_utils.mock_api_exception \ import MockApiException -from ansible_collections.dellemc.powerstore.plugins.modules.filesystem_snapshot import PowerStoreFilesystemSnapshot +from ansible_collections.dellemc.powerstore.plugins.modules.filesystem_snapshot import PowerStoreFilesystemSnapshot, main +from ansible_collections.dellemc.powerstore.tests.unit.plugins.module_utils.libraries.powerstore_unit_base \ + import PowerStoreUnitBase -class TestPowerstoreFilesystemSnapshot(): +class TestPowerstoreFilesystemSnapshot(PowerStoreUnitBase): get_module_args = MockFilesystemSnapshotApi.FILESYSTEM_SNAPSHOT_COMMON_ARGS @pytest.fixture - def filesystem_snapshot_module_mock(self, mocker): - mocker.patch(MockFilesystemSnapshotApi.MODULE_UTILS_PATH + '.PowerStoreException', new=MockApiException) - filesystem_snapshot_module_mock = PowerStoreFilesystemSnapshot() - filesystem_snapshot_module_mock.module = MagicMock() - return filesystem_snapshot_module_mock - - def test_get_filesystem_snapshot_by_id(self, filesystem_snapshot_module_mock): - self.get_module_args.update({ - 'snapshot_id': "61e49f3f-9b57-e69b-1038-aa02b52a030f", - 'state': "present" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]) - filesystem_snapshot_module_mock.perform_module_operation() - assert self.get_module_args['snapshot_id'] == filesystem_snapshot_module_mock.module.exit_json.call_args[1]['filesystem_snap_details']['id'] - - def test_get_filesystem_snapshot_by_name(self, filesystem_snapshot_module_mock): - self.get_module_args.update({ - 'snapshot_name': "Sample_FS_Snapshot", - 'filesystem': 'sample-filesystem', - 'nas_server': 'ansible_nas_server_2', - 'state': "present" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details_by_name = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS) - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]) - filesystem_snapshot_module_mock.perform_module_operation() - assert self.get_module_args['snapshot_name'] == filesystem_snapshot_module_mock.module.exit_json.call_args[1]['filesystem_snap_details']['name'] - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details_by_name.assert_called() - - def test_get_filesystem_snapshot_without_nas(self, filesystem_snapshot_module_mock): - self.get_module_args.update({ - 'snapshot_name': "Sample_FS_Snapshot", - 'state': "present" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details_by_name = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS) - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]) - filesystem_snapshot_module_mock.perform_module_operation() - assert MockFilesystemSnapshotApi.get_fs_snapshot_without_nas_failed_msg() in filesystem_snapshot_module_mock.module.fail_json.call_args[1]['msg'] - - def test_create_filesystem_snapshot(self, filesystem_snapshot_module_mock): - self.get_module_args.update({ - 'snapshot_name': "Sample_FS_Snapshot_1", - 'filesystem': 'sample-filesystem', - 'nas_server': 'ansible_nas_server_2', - 'desired_retention': 20, - 'retention_unit': 'days', - 'access_type': 'PROTOCOL', - 'state': "present" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details_by_name = MagicMock( + def module_object(self): + return PowerStoreFilesystemSnapshot + + def test_validate_expiration_timestamp(self, powerstore_module_mock): + expiration_timestamp = "2022-02-02T02:02:02Z" + ret = powerstore_module_mock.validate_expiration_timestamp( + expiration_timestamp) + assert ret is None + + def test_validate_expiration_timestamp_error(self, powerstore_module_mock): + expiration_timestamp = "2-02-02T02:02:02Z" + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("vet"), + powerstore_module_mock, "validate_expiration_timestamp", + expiration_timestamp) + + def test_validate_desired_retention(self, powerstore_module_mock): + desired_retention = 740 + retention_unit = "hours" + ret = powerstore_module_mock.validate_desired_retention( + desired_retention, retention_unit) + assert ret is None + + @pytest.mark.parametrize("params", [ + {"error_key": "vdr_err1", "retention_unit": "hours"}, + {"error_key": "vdr_err2", "retention_unit": "days"} + ]) + def test_validate_desired_retention_exception(self, powerstore_module_mock, params): + desired_retention = 750 + retention_unit = params.get("retention_unit", None) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message( + params.get("error_key", None) + ), + powerstore_module_mock, "validate_desired_retention", + desired_retention, retention_unit) + + @pytest.mark.parametrize("params", [ + {"nas_server_name": "nas_server_name"}, + {"nas_server_id": "nas_server_id"} + ]) + def test_get_nas_server(self, powerstore_module_mock, params): + nas_server_name = params.get("nas_server_name", None) + nas_server_id = params.get("nas_server_id", None) + ret_val = MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS + if nas_server_id: + ret_val = MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0] + powerstore_module_mock.provisioning.get_nas_server_details = MagicMock( + return_value=ret_val) + powerstore_module_mock.provisioning.get_nas_server_by_name = MagicMock( + return_value=ret_val) + ret = powerstore_module_mock.get_nas_server( + nas_server_name, nas_server_id) + assert ret == MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['id'] + + def test_get_nas_server_exp(self, powerstore_module_mock): + ret_val = None + powerstore_module_mock.provisioning.get_nas_server_by_name = MagicMock( + return_value=ret_val) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("nse_err1"), + powerstore_module_mock, "get_nas_server", + "nas_server_name") + + @pytest.mark.parametrize("params", [ + {"nas_server": "sample_nas_server"}, + {"nas_server": "61e4947b-8992-3db7-2859-aa02b52a0308"}, + ]) + def test_get_fs_id_from_filesystem_name(self, powerstore_module_mock, params): + filesystem = "sample_filesystem" + nas_server = params.get("nas_server", None) + powerstore_module_mock.get_nas_server = MagicMock( + return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['id'] + ) + powerstore_module_mock.provisioning.get_filesystem_by_name = MagicMock( + return_value=[ + {"id": MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['id']}] + ) + ret = powerstore_module_mock.get_fs_id_from_filesystem( + filesystem, nas_server) + assert ret == MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['id'] + + def test_get_fs_id_from_filesystem_uid(self, powerstore_module_mock): + filesystem = "61e4947b-8992-3db7-2859-aa02b52a0308" + nas_server = "61e4947b-8992-3db7-2859-aa02b52a0308" + powerstore_module_mock.provisioning.get_filesystem_details = MagicMock( + return_value={ + "id": MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['id']} + ) + ret = powerstore_module_mock.get_fs_id_from_filesystem( + filesystem, nas_server) + assert ret == MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['id'] + + @pytest.mark.parametrize("params", [ + {"nas_server": "sample_nas_server", "error_key": "nfe_err1"}, + {"nas_server": None, "error_key": "nfe_err2"} + ]) + def test_get_fs_id_from_filesystem_name_exp(self, powerstore_module_mock, params): + filesystem = "sample_filesystem" + nas_server = params.get("nas_server", None) + powerstore_module_mock.get_nas_server = MagicMock( + return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['id'] + ) + powerstore_module_mock.provisioning.get_filesystem_by_name = MagicMock( + return_value=None + ) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message( + params.get("error_key")), + powerstore_module_mock, "get_fs_id_from_filesystem", + filesystem, nas_server + ) + + def test_get_fs_name(self, powerstore_module_mock): + filesystem_id = "61e4947b-8992-3db7-2859-aa02b52a0308" + powerstore_module_mock.provisioning.get_filesystem_details = MagicMock( + return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0] + ) + ret = powerstore_module_mock.get_fs_name(filesystem_id) + assert ret == MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['name'] + + def test_get_fs_name_exp(self, powerstore_module_mock): + filesystem_id = "61e4947b-8992-3db7-2859-aa02b52a0308" + powerstore_module_mock.provisioning.get_filesystem_details = MagicMock( + return_value=MockApiException() + ) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("fs_name_exp"), + powerstore_module_mock, "get_fs_name", + filesystem_id + ) + + @pytest.mark.parametrize("params", [ + {"snapshot_name": "sample_snapshot", + "nas_server": "nas_server", + "sn_details": MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS, + "nas_server_id": "nas_server_id", + "ret_val": MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]}, + {"snapshot_name": "sample_snapshot", + "nas_server": "61e4947b-8992-3db7-2859-aa02b52a0308"}, + {"filesystem_id": "61e4947b-8992-3db7-2859-aa02b52a0308", + "nas_server": "nas_server", + "sn_details": MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS, + "nas_server_id": "nas_server_id", + "ret_val": MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]}, + ]) + def test_get_fs_snapshot(self, powerstore_module_mock, params): + snapshot_name = params.get("snapshot_name", None) + snapshot_id = "61e4947b-8992-3db7-2859-aa02b52a0302" + filesystem_id = "61e4947b-8992-3db7-2859-aa02b52a0308" + nas_server = params.get("nas_server", None) + powerstore_module_mock.get_nas_server = MagicMock( + return_value=params.get("nas_server_id") + ) + powerstore_module_mock.protection.get_filesystem_snapshot_details_by_name = MagicMock( + return_value=params.get("sn_details") + ) + powerstore_module_mock.protection.get_filesystem_snapshot_details = MagicMock( + return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0] + ) + powerstore_module_mock.get_fs_name = MagicMock( + return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]['parent_name'] + ) + ret = powerstore_module_mock.get_fs_snapshot(snapshot_name, snapshot_id, + filesystem_id, nas_server) + assert ret == params.get("ret_val") + + def test_get_fs_snapshot_exp1(self, powerstore_module_mock): + snapshot_name = "sample_snapshot" + snapshot_id = None + filesystem_id = None + nas_server = None + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("fs_snap_exp1"), + powerstore_module_mock, "get_fs_snapshot", + snapshot_name, snapshot_id, filesystem_id, nas_server + ) + + def test_get_fs_snapshot_exp2(self, powerstore_module_mock): + snapshot_name = "sample_snapshot" + snapshot_id = None + filesystem_id = "61e4947b-8992-3db7-2859-aa02b52a0318" + nas_server = "nas_server" + powerstore_module_mock.get_nas_server = MagicMock( + return_value="nas_server_id" + ) + powerstore_module_mock.protection.get_filesystem_snapshot_details_by_name = MagicMock( + return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS + ) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("fs_snap_exp2"), + powerstore_module_mock, "get_fs_snapshot", + snapshot_name, snapshot_id, filesystem_id, nas_server + ) + + def test_get_fs_snapshot_exp3(self, powerstore_module_mock): + snapshot_name = None + snapshot_id = "61e4947b-8992-3db7-2859-aa02b52a0302" + filesystem_id = "61e4947b-8992-3db7-2859-aa02b52a0318" + nas_server = "nas_server" + powerstore_module_mock.get_nas_server = MagicMock( + return_value="nas_server_id" + ) + powerstore_module_mock.protection.get_filesystem_snapshot_details = MagicMock( + side_effect=MockApiException + ) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("fs_snap_exp3"), + powerstore_module_mock, "get_fs_snapshot", + snapshot_name, snapshot_id, filesystem_id, nas_server + ) + + def test_create_filesystem_snapshot(self, powerstore_module_mock): + filesystem_id = "61e4947b-8992-3db7-2859-aa02b52a0308" + snapshot_name = "sample_snapshot" + description = "sample_description" + expiration_timestamp = 0 + access_type = "SNAPSHOT" + nas_server = "nas_server" + powerstore_module_mock.protection.create_filesystem_snapshot = MagicMock( + return_value=None + ) + ret = powerstore_module_mock.create_filesystem_snapshot( + filesystem_id, snapshot_name, description, expiration_timestamp, + access_type, nas_server + ) + assert ret is True + + @pytest.mark.parametrize("params", [ + {"filesystem_id": "61e4947b-8992-3db7-2859-aa02b52a0308", + "ret_value": "create_exp1", + "access_type": "SNAPSHOT", }, + {"snapshot_name": "sample_snapshot", + "ret_value": "create_exp2", + "access_type": "SNAPSHOT"}, + {"filesystem_id": "61e4947b-8992-3db7-2859-aa02b52a0308", + "snapshot_name": "sample_snapshot", + "ret_value": "create_exp3"}, + + ]) + def test_create_filesystem_snapshot_exp(self, powerstore_module_mock, params): + filesystem_id = params.get("filesystem_id", None) + snapshot_name = params.get("snapshot_name", None) + description = "sample_description" + expiration_timestamp = 0 + access_type = params.get("access_type", None) + nas_server = "nas_server" + powerstore_module_mock.protection.create_filesystem_snapshot = MagicMock( + side_effect=MockApiException + ) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message( + params.get("ret_value")), + powerstore_module_mock, "create_filesystem_snapshot", + filesystem_id, snapshot_name, description, expiration_timestamp, + access_type, nas_server + ) + + @pytest.mark.parametrize("params", [ + {"creation_timestamp": "2021-10-26T10:01:33.000Z", + "expiration_timestamp": "2021-11-26T10:01:33.000Z", + "retention_unit": "days", + "desired_retention": 1, + "ret_value": { + 'description': 'sample_description', + 'expiration_timestamp': '2021-10-27T10:01:00Z'} + }, + {"creation_timestamp": "2021-09-26T10:01:33.000Z", + "expiration_timestamp": "2021-08-26T10:01:33.000Z", + "retention_unit": "hours", + "desired_retention": 1, + "ret_value": { + 'description': 'sample_description', + 'expiration_timestamp': '2021-09-26T11:01:00Z'} + }, + { + "retention_unit": "hours", + "expiration_timestamp_param": "2021-07-26T10:01:33.000Z", + "ret_value": { + 'description': 'sample_description', + 'expiration_timestamp': '2021-07-26T10:01:33.000Z'} + }, + { + "retention_unit": "hours", + "expiration_timestamp": "2021-07-26T10:01:33.000Z", + "expiration_timestamp_param": "", + "ret_value": { + 'description': 'sample_description', + 'expiration_timestamp': '1970-01-01T00:00:00.000Z'} + }, + ]) + def test_check_fs_snapshot_modified(self, powerstore_module_mock, params): + snapshot = { + "expiration_timestamp": params.get("expiration_timestamp", None), + "access_type": "Snapshot", + "description": "sample_description1", + } + if params.get("creation_timestamp", None): + snapshot["creation_timestamp"] = params.get("creation_timestamp") + filesystem_id = "61e4947b-8992-3db7-2859-aa02b52a0308" + description = "sample_description" + desired_retention = params.get("desired_retention", None) + retention_unit = params.get("retention_unit", None) + expiration_timestamp = params.get("expiration_timestamp_param", None) + access_type = "SNAPSHOT" + nas_server = "nas_server" + ret = powerstore_module_mock.check_fs_snapshot_modified( + snapshot, filesystem_id, description, desired_retention, + retention_unit, expiration_timestamp, access_type, nas_server + ) + assert ret == params.get("ret_value") + + def test_check_fs_snapshot_modified_exp(self, powerstore_module_mock): + snapshot = { + "access_type": "SNAPSHOT", + } + filesystem_id = None + description = None + desired_retention = None + retention_unit = None + expiration_timestamp = None + access_type = "SNAPSHOT" + nas_server = None + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("fs_snap_mod_exp1"), + powerstore_module_mock, "check_fs_snapshot_modified", + snapshot, filesystem_id, description, desired_retention, + retention_unit, expiration_timestamp, access_type, nas_server + ) + + def test_modify_filesystem_snapshot(self, powerstore_module_mock): + snapshot = {"id": "61e4947b-8992-3db7-2859-aa02b52a0308"} + fs_snapshot_dict = {} + powerstore_module_mock.protection.modify_filesystem_snapshot = MagicMock( + return_value=None + ) + ret = powerstore_module_mock.modify_filesystem_snapshot( + snapshot, fs_snapshot_dict) + assert ret is True + + def test_modify_filesystem_snapsho_exp(self, powerstore_module_mock): + snapshot = { + "id": "61e4947b-8992-3db7-2859-aa02b52a0308", "name": "Name"} + fs_snapshot_dict = {} + powerstore_module_mock.protection.modify_filesystem_snapshot = MagicMock( + side_effect=MockApiException + ) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("mod_fs_snapshot"), + powerstore_module_mock, "modify_filesystem_snapshot", + snapshot, fs_snapshot_dict + ) + + def test_delete_filesystem_snapshot(self, powerstore_module_mock): + snapshot = {"id": "61e4947b-8992-3db7-2859-aa02b52a0308"} + powerstore_module_mock.protection.delete_filesystem_snapshot = MagicMock( + return_value=None + ) + ret = powerstore_module_mock.delete_filesystem_snapshot(snapshot) + assert ret is True + + def test_delete_filesystem_snapshot_exp(self, powerstore_module_mock): + snapshot = { + "id": "61e4947b-8992-3db7-2859-aa02b52a0308", "name": "Name"} + powerstore_module_mock.protection.delete_filesystem_snapshot = MagicMock( + side_effect=MockApiException + ) + self.capture_fail_json_method( + MockFilesystemSnapshotApi.get_error_message("del_fs_snapshot"), + powerstore_module_mock, "delete_filesystem_snapshot", + snapshot + ) + + @pytest.mark.parametrize("params", [ + { + "expiration_timestamp": "2021-07-26T10:01:33.000Z", + "desired_retention": "1", + "filesystem": "fileSystem", + "state": "present", + "get_fs_snapshot": {"id": "61e4947b-8992-3db7-2859-aa02b52a0308"}, + "ret_val": {'changed': True, 'create_fs_snap': '', + 'modify_fs_snap': True, 'delete_fs_snap': '', + 'filesystem_snap_details': + {'id': '61e4947b-8992-3db7-2859-aa02b52a0308'}} + }, + { + "expiration_timestamp": "2021-07-26T10:01:33.000Z", + "desired_retention": "1", + "filesystem": "fileSystem", + "state": "present", + "ret_val": {'changed': True, + 'create_fs_snap': + {"id": "61e4947b-8992-3db7-2859-aa02b52a0308"}, + 'modify_fs_snap': '', 'delete_fs_snap': '', + 'filesystem_snap_details': None} + }, + { + "state": "absent", + "get_fs_snapshot": {"id": "61e4947b-8992-3db7-2859-aa02b52a0308"}, + "ret_val": {'changed': True, 'create_fs_snap': '', + 'modify_fs_snap': '', 'delete_fs_snap': True, + 'filesystem_snap_details': ''} + }, + ]) + def test_perform_module_operation(self, powerstore_module_mock, params): + self.set_module_params( + powerstore_module_mock, + self.get_module_args, + {"expiration_timestamp": params.get("expiration_timestamp", None), + "desired_retention": params.get("desired_retention", None), + "filesystem": params.get("filesystem", None), + "state": params.get("state", None), + } + ) + powerstore_module_mock.validate_expiration_timestamp = MagicMock( + return_value=None + ) + powerstore_module_mock.validate_desired_retention = MagicMock( + return_value=None + ) + powerstore_module_mock.get_fs_id_from_filesystem = MagicMock( + return_value="61e4947b-8992-3db7-2859-aa02b52a0308" + ) + powerstore_module_mock.get_fs_snapshot = MagicMock( + return_value=params.get("get_fs_snapshot", None) + ) + powerstore_module_mock.check_fs_snapshot_modified = MagicMock( + return_value=params.get("get_fs_snapshot", None) + ) + powerstore_module_mock.create_filesystem_snapshot = MagicMock( + return_value={"id": "61e4947b-8992-3db7-2859-aa02b52a0308"} + ) + powerstore_module_mock.delete_filesystem_snapshot = MagicMock( + return_value=True + ) + powerstore_module_mock.perform_module_operation() + assert powerstore_module_mock.module.exit_json.call_args[1] == params.get("ret_val") + + def test_main(self, powerstore_module_mock, mocker): + + mock_obj = mocker.patch(MockFilesystemSnapshotApi.MODULE_PATH, + new=PowerStoreFilesystemSnapshot) + mock_obj.perform_module_operation = MagicMock( return_value=None) - filesystem_snapshot_module_mock.protection.create_filesystem_snapshot = MagicMock( - return_value=True) - filesystem_snapshot_module_mock.get_fs_snapshot = MagicMock( - return_value=MockFilesystemSnapshotApi.CREATE_FS_SNAPSHOT[0]) - filesystem_snapshot_module_mock.perform_module_operation() - assert filesystem_snapshot_module_mock.module.exit_json.call_args[1]['changed'] is True - - def test_modify_filesystem_snapshot(self, filesystem_snapshot_module_mock): - self.get_module_args.update({ - 'snapshot_name': "Sample_FS_Snapshot", - 'nas_server': 'ansible_nas_server_2', - 'description': 'Modify', - 'state': "present" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details_by_name = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]) - filesystem_snapshot_module_mock.protection.modify_filesystem_snapshot = MagicMock( - return_value=MockFilesystemSnapshotApi.MODIFY_FS_SNAPSHOT[0]) - filesystem_snapshot_module_mock.perform_module_operation() - assert filesystem_snapshot_module_mock.module.exit_json.call_args[1]['changed'] is True - - def test_delete_filesystem_snapshot(self, filesystem_snapshot_module_mock): - self.get_module_args.update({ - 'snapshot_name': "Sample_FS_Snapshot", - 'nas_server': 'ansible_nas_server_2', - 'state': "absent" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details_by_name = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS) - filesystem_snapshot_module_mock.perform_module_operation() - filesystem_snapshot_module_mock.protection.delete_filesystem_snapshot.assert_called() - assert filesystem_snapshot_module_mock.module.exit_json.call_args[1]['changed'] is True - - def test_modify_filesystem_snapshot_with_exception(self, filesystem_snapshot_module_mock): - MockApiException.HTTP_ERR = "1" - MockApiException.err_code = "1" - MockApiException.status_code = "400" - self.get_module_args.update({ - 'snapshot_id': "61e49f3f-9b57-e69b-1038-aa02b52a030f", - 'description': 'Modify', - 'state': "present" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]) - filesystem_snapshot_module_mock.protection.modify_filesystem_snapshot = MagicMock( - side_effect=MockApiException) - filesystem_snapshot_module_mock.perform_module_operation() - filesystem_snapshot_module_mock.protection.modify_filesystem_snapshot.assert_called() - - def test_delete_filesystem_snapshot_with_exception(self, filesystem_snapshot_module_mock): - MockApiException.HTTP_ERR = "1" - MockApiException.err_code = "1" - MockApiException.status_code = "400" - self.get_module_args.update({ - 'snapshot_id': "61e49f3f-9b57-e69b-1038-aa02b52a030f", - 'state': "absent" - }) - filesystem_snapshot_module_mock.module.params = self.get_module_args - filesystem_snapshot_module_mock.protection.get_filesystem_snapshot_details = MagicMock( - return_value=MockFilesystemSnapshotApi.FILESYSTEM_SNAP_DETAILS[0]) - filesystem_snapshot_module_mock.protection.delete_filesystem_snapshot = MagicMock( - side_effect=MockApiException) - filesystem_snapshot_module_mock.perform_module_operation() - filesystem_snapshot_module_mock.protection.delete_filesystem_snapshot.assert_called() + main() diff --git a/tests/unit/plugins/modules/test_security_config.py b/tests/unit/plugins/modules/test_security_config.py index 870fdb9..3970ad1 100644 --- a/tests/unit/plugins/modules/test_security_config.py +++ b/tests/unit/plugins/modules/test_security_config.py @@ -16,47 +16,98 @@ from ansible_collections.dellemc.powerstore.tests.unit.plugins.module_utils.mock_security_config_api import MockSecurityConfigApi from ansible_collections.dellemc.powerstore.tests.unit.plugins.module_utils.mock_api_exception \ import MockApiException -from ansible_collections.dellemc.powerstore.plugins.modules.security_config import PowerStoreSecurityConfig +from ansible_collections.dellemc.powerstore.plugins.modules.security_config import PowerStoreSecurityConfig, main +from ansible_collections.dellemc.powerstore.tests.unit.plugins.module_utils.libraries.powerstore_unit_base \ + import PowerStoreUnitBase -class TestPowerstoreSecurityConfig(): +class TestPowerstoreSecurityConfig(PowerStoreUnitBase): get_module_args = MockSecurityConfigApi.SECURITY_CONFIG_COMMON_ARGS @pytest.fixture - def security_config_module_mock(self, mocker): - mocker.patch(MockSecurityConfigApi.MODULE_UTILS_PATH + '.PowerStoreException', new=MockApiException) - security_config_module_mock = PowerStoreSecurityConfig() - return security_config_module_mock + def module_object(self): + return PowerStoreSecurityConfig - def test_get_security_config_response(self, security_config_module_mock): + def test_get_security_config_response(self, powerstore_module_mock): MockSecurityConfigApi.get_security_config_response('api') self.get_module_args.update({ 'security_config_id': "1", 'state': "present" }) - security_config_module_mock.module.params = self.get_module_args - security_config_module_mock.perform_module_operation() - security_config_module_mock.configuration.get_security_config_details.assert_called() + powerstore_module_mock.module.params = self.get_module_args + powerstore_module_mock.perform_module_operation() + powerstore_module_mock.configuration.get_security_config_details.assert_called() - def test_modify_security_config_response(self, security_config_module_mock): + def test_modify_security_config_response(self, powerstore_module_mock): MockSecurityConfigApi.modify_security_config_response('module') self.get_module_args.update({ 'security_config_id': "1", 'protocol_mode': "TLSv1_1", 'state': "present" }) - security_config_module_mock.module.params = self.get_module_args - security_config_module_mock.perform_module_operation() - security_config_module_mock.configuration.modify_security_config.assert_called() + powerstore_module_mock.module.params = self.get_module_args + powerstore_module_mock.perform_module_operation() + powerstore_module_mock.configuration.modify_security_config.assert_called() - def test_modify_security_config_invalid_protocol_mode_response(self, security_config_module_mock): + def test_modify_security_config_invalid_protocol_mode_response(self, powerstore_module_mock): MockSecurityConfigApi.modify_security_config_response('module') self.get_module_args.update({ 'security_config_id': "1", 'protocol_mode': "TLSv1_3", 'state': "present" }) - security_config_module_mock.module.params = self.get_module_args - security_config_module_mock.perform_module_operation() - security_config_module_mock.configuration.modify_security_config.assert_called() + powerstore_module_mock.module.params = self.get_module_args + powerstore_module_mock.perform_module_operation() + powerstore_module_mock.configuration.modify_security_config.assert_called() + + def test_get_security_config_details_exp(self, powerstore_module_mock): + security_config_id = 1 + powerstore_module_mock.configuration.get_security_config_details = MagicMock( + side_effect=MockApiException + ) + self.capture_fail_json_method( + MockSecurityConfigApi.get_error_message("scd_exp"), + powerstore_module_mock, "get_security_config_details", + security_config_id + ) + + def test_modify_security_config_exp(self, powerstore_module_mock): + security_config_id = 1 + protocol_mode = "TLSv1_1" + powerstore_module_mock.configuration.modify_security_config = MagicMock( + side_effect=MockApiException + ) + self.capture_fail_json_method( + MockSecurityConfigApi.get_error_message("msc_exp"), + powerstore_module_mock, "modify_security_config", + security_config_id, protocol_mode + ) + + @pytest.mark.parametrize('params', [ + {"state": "present", "exp_key": "pm_exp1"}, + {"state": "absent", "scd": "scd1", "exp_key": "pm_exp2"} + ]) + def test_perform_module_operation_exp(self, powerstore_module_mock, params): + MockSecurityConfigApi.modify_security_config_response('module') + self.get_module_args.update({ + 'security_config_id': "1", + 'protocol_mode': "TLSv1_3", + 'state': params.get('state', None) + }) + powerstore_module_mock.module.params = self.get_module_args + powerstore_module_mock.get_security_config_details = MagicMock( + return_value=params.get('scd', None) + ) + self.capture_fail_json_method( + MockSecurityConfigApi.get_error_message( + params.get('exp_key', None)), + powerstore_module_mock, "perform_module_operation" + ) + + def test_main(self, mocker): + mock_obj = mocker.patch(MockSecurityConfigApi.MODULE_PATH, + new=PowerStoreSecurityConfig) + mock_obj.perform_module_operation = MagicMock( + return_value=None) + main() diff --git a/tests/unit/plugins/modules/test_volume.py b/tests/unit/plugins/modules/test_volume.py index a32a854..ffccd90 100644 --- a/tests/unit/plugins/modules/test_volume.py +++ b/tests/unit/plugins/modules/test_volume.py @@ -301,17 +301,15 @@ def test_map_host_group_to_volume(self, volume_module_mock): def test_unmap_host_group_from_volume(self, volume_module_mock): self.get_module_args.update({ 'vol_id': "ae20eb9a-a482-416e-aaf7-2a3fe7203630", - 'hostgroup': 'd0a61806-0992-4e8b-9419-d47ac1ed563f', + 'hostgroup': "sample_host_group_2", 'mapping_state': 'unmapped', 'state': "present" }) volume_module_mock.module.params = self.get_module_args - volume_module_mock.provisioning.get_host_group_details = MagicMock( - return_value=MockVolumeApi.HG_DETAILS1[0]) + volume_module_mock.provisioning.get_host_group_by_name = MagicMock( + return_value=MockVolumeApi.HG_DETAILS2) volume_module_mock.provisioning.get_volume_details = MagicMock( return_value=MockVolumeApi.MODIFY_VOL_DETAILS1[0]) - volume_module_mock.provisioning.unmap_volume_from_host_group = MagicMock( - return_value=[]) volume_module_mock.perform_module_operation() assert volume_module_mock.module.exit_json.call_args[1]['changed'] is True volume_module_mock.provisioning.unmap_volume_from_host_group.assert_called() @@ -385,14 +383,14 @@ def test_unmap_host_group_from_volume_with_exception(self, volume_module_mock): MockApiException.status_code = "400" self.get_module_args.update({ 'vol_id': "ae20eb9a-a482-416e-aaf7-2a3fe7203630", - 'hostgroup': 'd0a61806-0992-4e8b-9419-d47ac1ed563f', + 'hostgroup': "sample_host_group_2", 'mapping_state': 'unmapped', 'hlu': 123, 'state': "present" }) volume_module_mock.module.params = self.get_module_args - volume_module_mock.provisioning.get_host_group_details = MagicMock( - return_value=MockVolumeApi.HG_DETAILS1[0]) + volume_module_mock.provisioning.get_host_group_by_name = MagicMock( + return_value=MockVolumeApi.HG_DETAILS2) volume_module_mock.provisioning.get_volume_details = MagicMock( return_value=MockVolumeApi.MODIFY_VOL_DETAILS1[0]) volume_module_mock.provisioning.unmap_volume_from_host_group = MagicMock( @@ -528,13 +526,13 @@ def test_map_host_to_volume_without_mapping_state(self, volume_module_mock): def test_map_existing_host_group_to_volume(self, volume_module_mock): self.get_module_args.update({ 'vol_name': "sample_volume_1", - 'hostgroup': 'sample_host_group', + 'hostgroup': 'sample_host_group2', 'mapping_state': 'mapped', 'state': "present" }) volume_module_mock.module.params = self.get_module_args volume_module_mock.provisioning.get_host_group_by_name = MagicMock( - return_value=MockVolumeApi.HG_DETAILS1) + return_value=MockVolumeApi.HG_DETAILS2) volume_module_mock.provisioning.get_volume_by_name = MagicMock( return_value=MockVolumeApi.MODIFY_VOL_DETAILS1) volume_module_mock.perform_module_operation() @@ -598,7 +596,7 @@ def operation_before_clone_volume(self, volume_module_mock): 'name': 'test_name_3', 'description': 'test description 1', 'host': 'hst_nm_1', - 'host_group': 'hst_gp_1', + 'host_group': "sample_host_group_2", 'logical_unit_number': 13, 'protection_policy': 'PP1', 'performance_policy': 'low' @@ -611,7 +609,7 @@ def operation_before_clone_volume(self, volume_module_mock): volume_module_mock.get_performance_policy = MagicMock(return_value=MockVolumeApi.PERFORMANCE_POLICY_LOW) volume_module_mock.get_protection_policy_id_by_name = MagicMock(return_value='PP_ID_1') volume_module_mock.get_host_id_by_name = MagicMock(return_value='HD_ID_1') - volume_module_mock.get_host_group_id_by_name = MagicMock(return_value='HD_GP_ID_1') + volume_module_mock.provisioning.get_host_group_details = MagicMock(return_value=MockVolumeApi.HG_DETAILS2) def test_clone_volume(self, volume_module_mock): self.operation_before_clone_volume(volume_module_mock)