Skip to content

Commit 2151df0

Browse files
author
Vivek Chaudhary
committed
[scm] OPSAPS-32644 addRepositories argument is not present in python API
- Fixed the api
1 parent e6bc828 commit 2151df0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

python/src/cm_api/endpoints/cms.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,13 @@ def end_trial(self):
483483
"""
484484
self._post("trial/end", None, api_version=6)
485485

486-
def import_cluster_template(self, api_cluster_template):
486+
def import_cluster_template(self, api_cluster_template, add_repositories=False):
487487
"""
488488
Create a cluster according to the provided template
489489
490490
@param api_cluster_template: cluster template to import
491+
@param add_repositories: if true the parcels repositories in the cluster template will be added.
491492
@return: Command handing cluster import
492493
@since: API v12
493494
"""
494-
return self._post("importClusterTemplate", ApiCommand, False, api_cluster_template, api_version=12)
495+
return self._post("importClusterTemplate", ApiCommand, False, api_cluster_template, params=dict(addRepositories=add_repositories), api_version=12)

python/src/cm_api_tests/test_cms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ def test_import_cluster_v12(self):
287287
resource.expect(
288288
method="POST",
289289
reqpath="/cm/importClusterTemplate",
290+
params=dict(addRepositories=True),
290291
data = data,
291292
retdata=ApiCommand(resource).to_json_dict())
292-
cms.import_cluster_template(data)
293+
cms.import_cluster_template(data, True)
293294

0 commit comments

Comments
 (0)