File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 33
33
- The Cloud Management ID
34
34
vars:
35
35
- name: ansible_cloud_mgmt_id
36
+ target:
37
+ type: str
38
+ description:
39
+ - target gateway
40
+ vars:
41
+ - name: ansible_checkpoint_target
36
42
"""
37
43
38
44
import json
@@ -89,10 +95,14 @@ def get_session_uid(self):
89
95
return self .connection ._session_uid
90
96
91
97
def send_request (self , path , body_params ):
92
- data = json .dumps (body_params ) if body_params else "{}"
93
98
cp_cloud_mgmt_id = self .get_option ("cloud_mgmt_id" )
94
99
if cp_cloud_mgmt_id :
95
100
path = "/" + cp_cloud_mgmt_id + path
101
+ # we only replace gaia_ip/ with web_api/gaia-api/ if target is set and path contains gaia_ip/
102
+ if 'gaia_api/' in path and self .get_option ("target" ):
103
+ path = path .replace ("gaia_api/" , "web_api/gaia-api/" )
104
+ body_params ['target' ] = self .get_option ("target" )
105
+ data = json .dumps (body_params ) if body_params else '{}'
96
106
try :
97
107
self ._display_request ()
98
108
response , response_data = self .connection .send (
You can’t perform that action at this time.
0 commit comments