Skip to content

Commit c78be85

Browse files
Fixed VM Migration Bug
Issue: 1) Module looks for the vm folder with provided name. In case of duplicate folder name available migration fails. Fix: 1) Filter folder name by source and resource pool Id.
1 parent 711c2d0 commit c78be85

26 files changed

+82
-83
lines changed

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace: cohesity
99
name: dataprotect
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: 1.1.4
12+
version: 1.1.5
1313

1414
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1515
readme: README.md

plugins/module_utils/cohesity_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
module_utils: cohesity_auth
1414
short_description: The **CohesityAuth** utils module provides the authentication token manage
1515
for Cohesity Platforms.
16-
version_added: 1.1.4
16+
version_added: 1.1.5
1717
description:
1818
- The **CohesityAuth** utils module provides the authentication token manage
1919
for Cohesity Platforms.

plugins/module_utils/cohesity_hints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
module_utils: cohesity_hints
1515
short_description: The **CohesityHints** utils module provides standard methods for returning query data
1616
from Cohesity Platforms.
17-
version_added: 1.1.4
17+
version_added: 1.1.5
1818
description:
1919
- The **CohesityHints** utils module provides standard methods for returning query data
2020
from Cohesity Platforms.
@@ -627,7 +627,7 @@ def unregister_source(module, self):
627627
headers = {
628628
"Accept": "application/json",
629629
"Authorization": "Bearer " + token,
630-
"user-agent": "cohesity-ansible/v1.1.4",
630+
"user-agent": "cohesity-ansible/v1.1.5",
631631
}
632632

633633
response = open_url(
@@ -701,7 +701,7 @@ def check__protection_group__exists(module, self):
701701
headers = {
702702
"Accept": "application/json",
703703
"Authorization": "Bearer " + self["token"],
704-
"user-agent": "cohesity-ansible/v1.1.4",
704+
"user-agent": "cohesity-ansible/v1.1.5",
705705
}
706706
response = open_url(
707707
url=uri,
@@ -760,7 +760,7 @@ def get_resource_pool_id(module, self):
760760
headers = {
761761
"Accept": "application/json",
762762
"Authorization": "Bearer " + token,
763-
"user-agent": "cohesity-ansible/v1.1.4",
763+
"user-agent": "cohesity-ansible/v1.1.5",
764764
}
765765
response = open_url(
766766
url=uri,

plugins/module_utils/cohesity_utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
module_utils: cohesity_utilities
1414
short_description: The **CohesityUtilities** utils module provides the authentication token manage
1515
for Cohesity Platforms.
16-
version_added: 1.1.4
16+
version_added: 1.1.5
1717
description:
1818
- The **CohesityUtilities** utils module provides the authentication token manage
1919
for Cohesity Platforms.

plugins/modules/cohesity_agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def download_agent(module, path):
305305
headers = {
306306
"Accept": "application/octet-stream",
307307
"Authorization": "Bearer " + token,
308-
"user-agent": "cohesity-ansible/v1.1.4",
308+
"user-agent": "cohesity-ansible/v1.1.5",
309309
}
310310
elif not module.params.get("download_uri"):
311311
os_type = "Linux"
@@ -334,13 +334,13 @@ def download_agent(module, path):
334334
headers = {
335335
"Accept": "application/octet-stream",
336336
"Authorization": "Bearer " + token,
337-
"user-agent": "cohesity-ansible/v1.1.4",
337+
"user-agent": "cohesity-ansible/v1.1.5",
338338
}
339339
else:
340340
uri = module.params.get("download_uri")
341341
headers = {
342342
"Accept": "application/octet-stream",
343-
"user-agent": "cohesity-ansible/v1.1.4",
343+
"user-agent": "cohesity-ansible/v1.1.5",
344344
}
345345

346346
agent = open_url(
@@ -612,7 +612,7 @@ def get_source_details(module, source_id):
612612
headers = {
613613
"Accept": "application/json",
614614
"Authorization": "Bearer " + token,
615-
"user-agent": "cohesity-ansible/v1.1.4",
615+
"user-agent": "cohesity-ansible/v1.1.5",
616616
}
617617
response = open_url(
618618
url=uri,
@@ -664,7 +664,7 @@ def update_agent(module):
664664
headers = {
665665
"Accept": "application/json",
666666
"Authorization": "Bearer " + token,
667-
"user-agent": "cohesity-ansible/v1.1.4",
667+
"user-agent": "cohesity-ansible/v1.1.5",
668668
}
669669
payload = {"agentIds": [source_details["agent"]["id"]]}
670670
open_url(

plugins/modules/cohesity_cancel_migration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
extends_documentation_fragment:
6565
- cohesity.dataprotect.cohesity
6666
short_description: Cancel the VM migration
67-
version_added: 1.1.4
67+
version_added: 1.1.5
6868
"""
6969

7070
EXAMPLES = """
@@ -129,7 +129,7 @@ def check__protection_restore__exists(module, self):
129129
headers = {
130130
"Accept": "application/json",
131131
"Authorization": "Bearer " + token,
132-
"user-agent": "cohesity-ansible/v1.1.4",
132+
"user-agent": "cohesity-ansible/v1.1.5",
133133
}
134134
response = open_url(
135135
url=uri,
@@ -176,7 +176,7 @@ def cancel_migration(module, task_id):
176176
headers = {
177177
"Accept": "application/json",
178178
"Authorization": "Bearer " + token,
179-
"user-agent": "cohesity-ansible/v1.1.4",
179+
"user-agent": "cohesity-ansible/v1.1.5",
180180
}
181181
response = open_url(
182182
url=uri,

plugins/modules/cohesity_clone_vm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
extends_documentation_fragment:
128128
- cohesity.dataprotect.cohesity
129129
short_description: "Management of Cohesity VM Clone"
130-
version_added: 1.1.4
130+
version_added: 1.1.5
131131
"""
132132

133133

@@ -506,7 +506,7 @@ def main():
506506

507507
global cohesity_client
508508
base_controller = BaseController()
509-
base_controller.global_headers["user-agent"] = "cohesity-ansible/v1.1.4"
509+
base_controller.global_headers["user-agent"] = "cohesity-ansible/v1.1.5"
510510
cohesity_client = get_cohesity_client(module)
511511
clone_exists, clone_details = get_clone_task(module, False)
512512

plugins/modules/cohesity_facts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
short_description: Gather facts about a Cohesity Cluster.
1616
description:
1717
- Gather facts about Cohesity Clusters.
18-
version_added: 1.1.4
18+
version_added: 1.1.5
1919
author: "Naveena (@naveena-maplelabs)"
2020
options:
2121
cluster:

plugins/modules/cohesity_finalize_migration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
extends_documentation_fragment:
6666
- cohesity.dataprotect.cohesity
6767
short_description: Finalize the VM migration
68-
version_added: 1.1.4
68+
version_added: 1.1.5
6969
"""
7070

7171
EXAMPLES = """
@@ -154,7 +154,7 @@ def finalize_migration(module, self):
154154
headers = {
155155
"Accept": "application/json",
156156
"Authorization": "Bearer " + token,
157-
"user-agent": "cohesity-ansible/v1.1.4",
157+
"user-agent": "cohesity-ansible/v1.1.5",
158158
}
159159
body = {
160160
"restoreTaskId": self["task_id"],

plugins/modules/cohesity_job.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
extends_documentation_fragment:
228228
- cohesity.dataprotect.cohesity
229229
short_description: "Management of Cohesity Protection Jobs"
230-
version_added: 1.1.4
230+
version_added: 1.1.5
231231
"""
232232

233233
EXAMPLES = """
@@ -586,7 +586,7 @@ def get_vmware_ids(module, job_meta_data, job_details, vm_names):
586586
headers = {
587587
"Accept": "application/json",
588588
"Authorization": "Bearer " + token,
589-
"user-agent": "cohesity-ansible/v1.1.4",
589+
"user-agent": "cohesity-ansible/v1.1.5",
590590
}
591591
response = open_url(
592592
url=uri,
@@ -624,7 +624,7 @@ def get_vmware_vm_ids(module, job_meta_data, job_details, vm_names):
624624
headers = {
625625
"Accept": "application/json",
626626
"Authorization": "Bearer " + token,
627-
"user-agent": "cohesity-ansible/v1.1.4",
627+
"user-agent": "cohesity-ansible/v1.1.5",
628628
}
629629
response = open_url(
630630
url=uri,
@@ -670,7 +670,7 @@ def get_view_storage_domain_id(module, self):
670670
headers = {
671671
"Accept": "application/json",
672672
"Authorization": "Bearer " + token,
673-
"user-agent": "cohesity-ansible/v1.1.4",
673+
"user-agent": "cohesity-ansible/v1.1.5",
674674
}
675675
response = open_url(
676676
url=uri,
@@ -735,7 +735,7 @@ def register_job(module, self):
735735
headers = {
736736
"Accept": "application/json",
737737
"Authorization": "Bearer " + token,
738-
"user-agent": "cohesity-ansible/v1.1.4",
738+
"user-agent": "cohesity-ansible/v1.1.5",
739739
}
740740
payload = self.copy()
741741

@@ -840,7 +840,7 @@ def start_job(module, self):
840840
headers = {
841841
"Accept": "application/json",
842842
"Authorization": "Bearer " + token,
843-
"user-agent": "cohesity-ansible/v1.1.4",
843+
"user-agent": "cohesity-ansible/v1.1.5",
844844
}
845845
source_ids = payload.get("sourceIds", [])
846846
payload = dict()
@@ -899,7 +899,7 @@ def update_job(module, job_details, update_source_ids=None):
899899
headers = {
900900
"Accept": "application/json",
901901
"Authorization": "Bearer " + token,
902-
"user-agent": "cohesity-ansible/v1.1.4",
902+
"user-agent": "cohesity-ansible/v1.1.5",
903903
}
904904
payload = job_details.copy()
905905
del payload["token"]
@@ -961,7 +961,7 @@ def get_prot_job_details(self, module):
961961
headers = {
962962
"Accept": "application/json",
963963
"Authorization": "Bearer " + token,
964-
"user-agent": "cohesity-ansible/v1.1.4",
964+
"user-agent": "cohesity-ansible/v1.1.5",
965965
}
966966
response = open_url(
967967
url=uri,
@@ -1022,7 +1022,7 @@ def stop_job(module, self):
10221022
headers = {
10231023
"Accept": "application/json",
10241024
"Authorization": "Bearer " + token,
1025-
"user-agent": "cohesity-ansible/v1.1.4",
1025+
"user-agent": "cohesity-ansible/v1.1.5",
10261026
}
10271027
payload = self.copy()
10281028

@@ -1086,7 +1086,7 @@ def unregister_job(module, self):
10861086
headers = {
10871087
"Accept": "application/json",
10881088
"Authorization": "Bearer " + token,
1089-
"user-agent": "cohesity-ansible/v1.1.4",
1089+
"user-agent": "cohesity-ansible/v1.1.5",
10901090
}
10911091

10921092
payload = dict(deleteSnapshots=self["deleteSnapshots"])

0 commit comments

Comments
 (0)