diff --git a/molecule/gcloud/tests/test_default.py b/molecule/gcloud/tests/test_default.py index bb70e74..bb43def 100644 --- a/molecule/gcloud/tests/test_default.py +++ b/molecule/gcloud/tests/test_default.py @@ -1,10 +1,9 @@ -__metaclass__ = type - from __future__ import (absolute_import, division, print_function) - import os import testinfra.utils.ansible_runner +__metaclass__ = type + testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') diff --git a/molecule/gcsfuse/tests/test_default.py b/molecule/gcsfuse/tests/test_default.py index bb70e74..bb43def 100644 --- a/molecule/gcsfuse/tests/test_default.py +++ b/molecule/gcsfuse/tests/test_default.py @@ -1,10 +1,9 @@ -__metaclass__ = type - from __future__ import (absolute_import, division, print_function) - import os import testinfra.utils.ansible_runner +__metaclass__ = type + testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') diff --git a/plugins/module_utils/gcp_utils.py b/plugins/module_utils/gcp_utils.py index 20256fa..643c8ca 100644 --- a/plugins/module_utils/gcp_utils.py +++ b/plugins/module_utils/gcp_utils.py @@ -288,7 +288,8 @@ class GcpModule(AnsibleModule): scopes=dict( required=False, fallback=(env_fallback, ['GCP_SCOPES']), - type='list'), + type='list', + elements='str'), env_type=dict( required=False, fallback=(env_fallback, ['GCP_ENV_TYPE']), diff --git a/plugins/modules/gcp_storage_object.py b/plugins/modules/gcp_storage_object.py index 266acf0..4b0a4e8 100644 --- a/plugins/modules/gcp_storage_object.py +++ b/plugins/modules/gcp_storage_object.py @@ -23,7 +23,6 @@ module: gcp_storage_object description: - Upload or download a file from a GCS bucket. short_description: Creates a GCP Object -version_added: '2.8' author: Google Inc. (@googlecloudplatform) requirements: - python >= 2.6 @@ -87,6 +86,7 @@ options: description: - Array of scopes to be used type: list + elements: str env_type: description: - Specifies which Ansible environment you're running this module within. @@ -145,7 +145,7 @@ storage_class: # Imports ################################################################################ -from ansible.module_utils.gcp_utils import ( +from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import ( navigate_hash, GcpSession, GcpModule, diff --git a/roles/stackdriver_logging/molecule/default/tests/test_default.py b/roles/stackdriver_logging/molecule/default/tests/test_default.py index cfdfad4..01ddd3c 100644 --- a/roles/stackdriver_logging/molecule/default/tests/test_default.py +++ b/roles/stackdriver_logging/molecule/default/tests/test_default.py @@ -1,11 +1,9 @@ -__metaclass__ = type - from __future__ import (absolute_import, division, print_function) - import os - import testinfra.utils.ansible_runner +__metaclass__ = type + testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE'] ).get_hosts('all') diff --git a/roles/stackdriver_monitoring/molecule/default/tests/test_default.py b/roles/stackdriver_monitoring/molecule/default/tests/test_default.py index a5c5868..01ddd3c 100644 --- a/roles/stackdriver_monitoring/molecule/default/tests/test_default.py +++ b/roles/stackdriver_monitoring/molecule/default/tests/test_default.py @@ -1,10 +1,9 @@ -__metaclass__ = type from __future__ import (absolute_import, division, print_function) - import os - import testinfra.utils.ansible_runner +__metaclass__ = type + testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE'] ).get_hosts('all') diff --git a/tests/unit/plugins/test_gcp_utils.py b/tests/unit/plugins/test_gcp_utils.py index c583f33..a69f36a 100644 --- a/tests/unit/plugins/test_gcp_utils.py +++ b/tests/unit/plugins/test_gcp_utils.py @@ -24,6 +24,8 @@ from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import (Gcp remove_nones_from_dict, replace_resource_dict) +__metaclass__ = type + class ReplaceResourceDictTestCase(unittest.TestCase): def test_given_dict(self):