Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed collection failure issues for some ansible version #56

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plugins/module_utils/cohesity_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@


import json
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error


class ParameterViolation(Exception):
Expand Down
6 changes: 5 additions & 1 deletion plugins/module_utils/cohesity_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
except ImportError:
from urllib.parse import quote

from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error
from ansible.module_utils.six.moves import urllib_parse

try:
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_bytes
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error
from tempfile import mkdtemp

try:
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_cancel_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@
import json

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_finalize_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@
import json

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,11 @@
import time
from collections import defaultdict
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_migrate_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@

from datetime import datetime
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_migration_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@

from collections import defaultdict
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
5 changes: 4 additions & 1 deletion plugins/modules/cohesity_oracle_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,14 @@
import copy
import time
from ansible.module_utils.basic import AnsibleModule
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
# => the expectation is that the modules will live under ansible.
from ansible.module_utils.urls import urllib_error
from ansible_collections.cohesity.dataprotect.plugins.module_utils.cohesity_hints import (
get_cohesity_client,
)
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_oracle_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@
import json
import time
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@

# Ansible Imports.
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

from ansible_collections.cohesity.dataprotect.plugins.module_utils.cohesity_auth import (
get__cohesity_auth__token,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_restore_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@
import time
from datetime import datetime
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_restore_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,11 @@
except ImportError:
from urllib.parse import quote
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_restore_vmware_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@
import time
from datetime import datetime
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@
import json
import time
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_sync_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@
import json

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
7 changes: 5 additions & 2 deletions plugins/modules/cohesity_uda_protection_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,15 @@


from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
# => the expectation is that the modules will live under ansible.
from ansible.module_utils.urls import urllib_error
from ansible_collections.cohesity.dataprotect.plugins.module_utils.cohesity_auth import (
get__cohesity_auth__token,
)
Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/cohesity_uda_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@

import json
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
from ansible.module_utils.urls import open_url
try:
from urllib import error as urllib_error
except ImportError:
from ansible.module_utils.urls import urllib_error

try:
# => When unit testing, we need to look in the correct location however, when run via ansible,
Expand Down
Loading