Skip to content

Commit

Permalink
Resolved ansible lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kavinagrawalcohesity committed May 13, 2024
1 parent 1b3cb2b commit 1c7f4c7
Show file tree
Hide file tree
Showing 28 changed files with 424 additions and 350 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace: cohesity
name: dataprotect

# The version of the collection. Must be compatible with semantic versioning
version: 1.1.10
version: 1.2.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/cohesity_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
module_utils: cohesity_auth
short_description: The **CohesityAuth** utils module provides the authentication token manage
for Cohesity Platforms.
version_added: 1.1.10
version_added: 1.2.0
description:
- The **CohesityAuth** utils module provides the authentication token manage
for Cohesity Platforms.
Expand Down
8 changes: 4 additions & 4 deletions plugins/module_utils/cohesity_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
module_utils: cohesity_hints
short_description: The **CohesityHints** utils module provides standard methods for returning query data
from Cohesity Platforms.
version_added: 1.1.10
version_added: 1.2.0
description:
- The **CohesityHints** utils module provides standard methods for returning query data
from Cohesity Platforms.
Expand Down Expand Up @@ -683,7 +683,7 @@ def unregister_source(module, self):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}

response = open_url(
Expand Down Expand Up @@ -757,7 +757,7 @@ def check__protection_group__exists(module, self):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + self["token"],
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
response = open_url(
url=uri,
Expand Down Expand Up @@ -816,7 +816,7 @@ def get_resource_pool_id(module, self):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
response = open_url(
url=uri,
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/cohesity_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
module_utils: cohesity_utilities
short_description: The **CohesityUtilities** utils module provides the authentication token manage
for Cohesity Platforms.
version_added: 1.1.10
version_added: 1.2.0
description:
- The **CohesityUtilities** utils module provides the authentication token manage
for Cohesity Platforms.
Expand Down
14 changes: 8 additions & 6 deletions plugins/modules/cohesity_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
- "directory will be created in the default System Temp Directory. When choosing an alternate directory,"
- "the directory and installer will not be deleted at the end of the execution."
type: str
default: ""
download_uri:
default: ""
description:
Expand All @@ -80,6 +81,7 @@
description:
- "ansible_distribution from facts, this value is automatically populated. Not given by module user"
type: str
default: ""
service_group:
default: cohesityagent
description:
Expand Down Expand Up @@ -118,7 +120,7 @@
extends_documentation_fragment:
- cohesity.dataprotect.cohesity
short_description: "Management of Cohesity Physical Agent"
version_added: 1.0.8
version_added: 1.2.0
"""

import os
Expand Down Expand Up @@ -305,7 +307,7 @@ def download_agent(module, path):
headers = {
"Accept": "application/octet-stream",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
elif not module.params.get("download_uri"):
os_type = "Linux"
Expand Down Expand Up @@ -334,13 +336,13 @@ def download_agent(module, path):
headers = {
"Accept": "application/octet-stream",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
else:
uri = module.params.get("download_uri")
headers = {
"Accept": "application/octet-stream",
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}

agent = open_url(
Expand Down Expand Up @@ -612,7 +614,7 @@ def get_source_details(module, source_id):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
response = open_url(
url=uri,
Expand Down Expand Up @@ -664,7 +666,7 @@ def update_agent(module):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
payload = {"agentIds": [source_details["agent"]["id"]]}
open_url(
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/cohesity_cancel_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
extends_documentation_fragment:
- cohesity.dataprotect.cohesity
short_description: Cancel the VM migration
version_added: 1.1.10
version_added: 1.2.0
"""

EXAMPLES = """
Expand Down Expand Up @@ -123,7 +123,7 @@ def check__protection_restore__exists(module, self):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
response = open_url(
url=uri,
Expand Down Expand Up @@ -170,7 +170,7 @@ def cancel_migration(module, task_id):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
response = open_url(
url=uri,
Expand Down
9 changes: 7 additions & 2 deletions plugins/modules/cohesity_clone_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- "Option to identify backups based on a timestamp"
required: false
type: str
default: ""
cluster:
aliases:
- cohesity_server
Expand Down Expand Up @@ -51,6 +52,7 @@
- "Option to identify backups based on a end timestamp"
required: false
type: str
default: ""
environment:
choices:
- VMware
Expand Down Expand Up @@ -83,6 +85,7 @@
description:
- "Specifies a prefix to prepended to the source object name to derive a new name for the recovered or cloned object."
type: str
default: ""
resource_pool:
required: true
description:
Expand All @@ -93,6 +96,7 @@
- "Option to identify backups based on a start timestamp."
required: false
type: str
default: ""
state:
choices:
- present
Expand All @@ -104,6 +108,7 @@
suffix:
description: "Specifies a suffix to appended to the original source object name to derive a new name for the recovered or cloned object."
type: str
default: ""
view_name:
description:
- "Name of the view"
Expand All @@ -127,7 +132,7 @@
extends_documentation_fragment:
- cohesity.dataprotect.cohesity
short_description: "Management of Cohesity VM Clone"
version_added: 1.1.10
version_added: 1.2.0
"""


Expand Down Expand Up @@ -506,7 +511,7 @@ def main():

global cohesity_client
base_controller = BaseController()
base_controller.global_headers["user-agent"] = "cohesity-ansible/v1.1.10"
base_controller.global_headers["user-agent"] = "cohesity-ansible/v1.2.0"
cohesity_client = get_cohesity_client(module)
clone_exists, clone_details = get_clone_task(module, False)

Expand Down
8 changes: 5 additions & 3 deletions plugins/modules/cohesity_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
short_description: Gather facts about a Cohesity Cluster.
description:
- Gather facts about Cohesity Clusters.
version_added: 1.1.10
version_added: 1.2.0
author: "Naveena (@naveena-maplelabs)"
options:
cluster:
Expand Down Expand Up @@ -83,10 +83,12 @@
type: bool
default: no
validate_certs:
default: false
default: true
description:
- "Switch determines if SSL Validation should be enabled."
type: bool
aliases:
- cohesity_validate_certs
"""

Expand Down Expand Up @@ -159,7 +161,7 @@ def main():
)
)

module = AnsibleModule(argument_spec=argument_spec)
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
global cohesity_client
cohesity_client = get_cohesity_client(module)
results = dict(changed=False, cluster="")
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/cohesity_finalize_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
extends_documentation_fragment:
- cohesity.dataprotect.cohesity
short_description: Finalize the VM migration
version_added: 1.1.10
version_added: 1.2.0
"""

EXAMPLES = """
Expand Down Expand Up @@ -148,7 +148,7 @@ def finalize_migration(module, self):
headers = {
"Accept": "application/json",
"Authorization": "Bearer " + token,
"user-agent": "cohesity-ansible/v1.1.10",
"user-agent": "cohesity-ansible/v1.2.0",
}
body = {
"restoreTaskId": self["task_id"],
Expand Down
Loading

0 comments on commit 1c7f4c7

Please sign in to comment.