tccli 3.0.1217.1__py2.py3-none-any.whl → 3.0.1218.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/command.py +0 -1
  3. tccli/configure.py +11 -1
  4. tccli/services/aa/aa_client.py +13 -1
  5. tccli/services/aai/aai_client.py +13 -1
  6. tccli/services/acp/acp_client.py +13 -1
  7. tccli/services/advisor/advisor_client.py +13 -1
  8. tccli/services/af/af_client.py +13 -1
  9. tccli/services/afc/afc_client.py +13 -1
  10. tccli/services/aiart/aiart_client.py +13 -1
  11. tccli/services/ame/ame_client.py +13 -1
  12. tccli/services/ams/ams_client.py +13 -1
  13. tccli/services/anicloud/anicloud_client.py +13 -1
  14. tccli/services/antiddos/antiddos_client.py +13 -1
  15. tccli/services/apcas/apcas_client.py +13 -1
  16. tccli/services/ape/ape_client.py +13 -1
  17. tccli/services/api/api_client.py +13 -1
  18. tccli/services/apigateway/apigateway_client.py +13 -1
  19. tccli/services/apm/apm_client.py +13 -1
  20. tccli/services/asr/asr_client.py +13 -1
  21. tccli/services/asw/asw_client.py +13 -1
  22. tccli/services/autoscaling/autoscaling_client.py +13 -1
  23. tccli/services/ba/ba_client.py +13 -1
  24. tccli/services/batch/batch_client.py +13 -1
  25. tccli/services/bda/bda_client.py +13 -1
  26. tccli/services/bh/bh_client.py +13 -1
  27. tccli/services/bi/bi_client.py +13 -1
  28. tccli/services/billing/billing_client.py +13 -1
  29. tccli/services/bizlive/bizlive_client.py +13 -1
  30. tccli/services/bm/bm_client.py +13 -1
  31. tccli/services/bma/bma_client.py +13 -1
  32. tccli/services/bmeip/bmeip_client.py +13 -1
  33. tccli/services/bmlb/bmlb_client.py +13 -1
  34. tccli/services/bmvpc/bmvpc_client.py +13 -1
  35. tccli/services/bpaas/bpaas_client.py +13 -1
  36. tccli/services/bri/bri_client.py +13 -1
  37. tccli/services/bsca/bsca_client.py +13 -1
  38. tccli/services/btoe/btoe_client.py +13 -1
  39. tccli/services/ca/ca_client.py +13 -1
  40. tccli/services/cam/cam_client.py +13 -1
  41. tccli/services/captcha/captcha_client.py +13 -1
  42. tccli/services/car/car_client.py +13 -1
  43. tccli/services/cat/cat_client.py +13 -1
  44. tccli/services/cbs/cbs_client.py +13 -1
  45. tccli/services/ccc/ccc_client.py +13 -1
  46. tccli/services/cdb/cdb_client.py +13 -1
  47. tccli/services/cdc/cdc_client.py +13 -1
  48. tccli/services/cdn/cdn_client.py +13 -1
  49. tccli/services/cds/cds_client.py +13 -1
  50. tccli/services/cdwch/cdwch_client.py +13 -1
  51. tccli/services/cdwdoris/cdwdoris_client.py +13 -1
  52. tccli/services/cdwpg/cdwpg_client.py +13 -1
  53. tccli/services/cdz/cdz_client.py +13 -1
  54. tccli/services/cfg/cfg_client.py +13 -1
  55. tccli/services/cfs/cfs_client.py +13 -1
  56. tccli/services/cfw/cfw_client.py +13 -1
  57. tccli/services/chdfs/chdfs_client.py +13 -1
  58. tccli/services/ciam/ciam_client.py +13 -1
  59. tccli/services/cii/cii_client.py +13 -1
  60. tccli/services/cim/cim_client.py +13 -1
  61. tccli/services/cis/cis_client.py +13 -1
  62. tccli/services/ckafka/ckafka_client.py +13 -1
  63. tccli/services/clb/clb_client.py +13 -1
  64. tccli/services/cloudapp/cloudapp_client.py +13 -1
  65. tccli/services/cloudaudit/cloudaudit_client.py +13 -1
  66. tccli/services/cloudhsm/cloudhsm_client.py +13 -1
  67. tccli/services/cloudstudio/cloudstudio_client.py +13 -1
  68. tccli/services/cls/cls_client.py +13 -1
  69. tccli/services/cme/cme_client.py +13 -1
  70. tccli/services/cmq/cmq_client.py +13 -1
  71. tccli/services/cms/cms_client.py +13 -1
  72. tccli/services/config/config_client.py +13 -1
  73. tccli/services/controlcenter/controlcenter_client.py +13 -1
  74. tccli/services/cpdp/cpdp_client.py +13 -1
  75. tccli/services/csip/csip_client.py +13 -1
  76. tccli/services/csxg/csxg_client.py +13 -1
  77. tccli/services/cvm/cvm_client.py +13 -1
  78. tccli/services/cwp/cwp_client.py +13 -1
  79. tccli/services/cws/cws_client.py +13 -1
  80. tccli/services/cynosdb/cynosdb_client.py +13 -1
  81. tccli/services/dasb/dasb_client.py +13 -1
  82. tccli/services/dataintegration/dataintegration_client.py +13 -1
  83. tccli/services/dayu/dayu_client.py +13 -1
  84. tccli/services/dbbrain/dbbrain_client.py +13 -1
  85. tccli/services/dbdc/dbdc_client.py +13 -1
  86. tccli/services/dc/dc_client.py +13 -1
  87. tccli/services/dcdb/dcdb_client.py +13 -1
  88. tccli/services/dlc/dlc_client.py +13 -1
  89. tccli/services/dnspod/dnspod_client.py +13 -1
  90. tccli/services/domain/domain_client.py +13 -1
  91. tccli/services/drm/drm_client.py +13 -1
  92. tccli/services/ds/ds_client.py +13 -1
  93. tccli/services/dsgc/dsgc_client.py +13 -1
  94. tccli/services/dtf/dtf_client.py +13 -1
  95. tccli/services/dts/dts_client.py +13 -1
  96. tccli/services/eb/eb_client.py +13 -1
  97. tccli/services/ecc/ecc_client.py +13 -1
  98. tccli/services/ecdn/ecdn_client.py +13 -1
  99. tccli/services/ecm/ecm_client.py +13 -1
  100. tccli/services/eiam/eiam_client.py +13 -1
  101. tccli/services/eis/eis_client.py +13 -1
  102. tccli/services/emr/emr_client.py +13 -1
  103. tccli/services/es/es_client.py +13 -1
  104. tccli/services/ess/ess_client.py +13 -1
  105. tccli/services/essbasic/essbasic_client.py +13 -1
  106. tccli/services/facefusion/facefusion_client.py +13 -1
  107. tccli/services/faceid/faceid_client.py +13 -1
  108. tccli/services/fmu/fmu_client.py +13 -1
  109. tccli/services/ft/ft_client.py +13 -1
  110. tccli/services/gaap/gaap_client.py +13 -1
  111. tccli/services/gme/gme_client.py +13 -1
  112. tccli/services/goosefs/goosefs_client.py +13 -1
  113. tccli/services/gpm/gpm_client.py +13 -1
  114. tccli/services/gs/gs_client.py +13 -1
  115. tccli/services/gse/gse_client.py +13 -1
  116. tccli/services/gwlb/gwlb_client.py +13 -1
  117. tccli/services/habo/habo_client.py +13 -1
  118. tccli/services/hai/hai_client.py +13 -1
  119. tccli/services/hasim/hasim_client.py +13 -1
  120. tccli/services/hcm/hcm_client.py +13 -1
  121. tccli/services/hunyuan/hunyuan_client.py +13 -1
  122. tccli/services/iai/iai_client.py +13 -1
  123. tccli/services/ic/ic_client.py +13 -1
  124. tccli/services/icr/icr_client.py +13 -1
  125. tccli/services/ie/ie_client.py +13 -1
  126. tccli/services/iecp/iecp_client.py +13 -1
  127. tccli/services/ig/ig_client.py +13 -1
  128. tccli/services/iir/iir_client.py +13 -1
  129. tccli/services/ims/ims_client.py +13 -1
  130. tccli/services/ioa/ioa_client.py +13 -1
  131. tccli/services/iot/iot_client.py +13 -1
  132. tccli/services/iotcloud/iotcloud_client.py +13 -1
  133. tccli/services/iotexplorer/iotexplorer_client.py +13 -1
  134. tccli/services/iottid/iottid_client.py +13 -1
  135. tccli/services/iotvideo/iotvideo_client.py +13 -1
  136. tccli/services/iotvideoindustry/iotvideoindustry_client.py +13 -1
  137. tccli/services/irp/irp_client.py +13 -1
  138. tccli/services/iss/iss_client.py +13 -1
  139. tccli/services/ivld/ivld_client.py +13 -1
  140. tccli/services/keewidb/keewidb_client.py +13 -1
  141. tccli/services/kms/kms_client.py +13 -1
  142. tccli/services/lcic/lcic_client.py +13 -1
  143. tccli/services/lighthouse/lighthouse_client.py +13 -1
  144. tccli/services/live/live_client.py +13 -1
  145. tccli/services/lke/lke_client.py +13 -1
  146. tccli/services/lowcode/lowcode_client.py +13 -1
  147. tccli/services/lp/lp_client.py +13 -1
  148. tccli/services/mall/mall_client.py +13 -1
  149. tccli/services/mariadb/mariadb_client.py +13 -1
  150. tccli/services/market/market_client.py +13 -1
  151. tccli/services/memcached/memcached_client.py +13 -1
  152. tccli/services/mgobe/mgobe_client.py +13 -1
  153. tccli/services/mmps/mmps_client.py +13 -1
  154. tccli/services/mna/mna_client.py +13 -1
  155. tccli/services/mongodb/mongodb_client.py +13 -1
  156. tccli/services/monitor/monitor_client.py +13 -1
  157. tccli/services/mps/mps_client.py +13 -1
  158. tccli/services/mqtt/mqtt_client.py +13 -1
  159. tccli/services/mrs/mrs_client.py +13 -1
  160. tccli/services/ms/ms_client.py +13 -1
  161. tccli/services/msp/msp_client.py +13 -1
  162. tccli/services/mvj/mvj_client.py +13 -1
  163. tccli/services/nlp/nlp_client.py +13 -1
  164. tccli/services/npp/npp_client.py +13 -1
  165. tccli/services/oceanus/oceanus_client.py +13 -1
  166. tccli/services/ocr/ocr_client.py +13 -1
  167. tccli/services/omics/omics_client.py +13 -1
  168. tccli/services/organization/organization_client.py +13 -1
  169. tccli/services/partners/partners_client.py +13 -1
  170. tccli/services/pds/pds_client.py +13 -1
  171. tccli/services/postgres/postgres_client.py +13 -1
  172. tccli/services/privatedns/privatedns_client.py +13 -1
  173. tccli/services/pts/pts_client.py +13 -1
  174. tccli/services/rce/rce_client.py +13 -1
  175. tccli/services/redis/redis_client.py +13 -1
  176. tccli/services/region/region_client.py +13 -1
  177. tccli/services/rkp/rkp_client.py +13 -1
  178. tccli/services/rp/rp_client.py +13 -1
  179. tccli/services/rum/rum_client.py +13 -1
  180. tccli/services/scf/scf_client.py +13 -1
  181. tccli/services/ses/ses_client.py +13 -1
  182. tccli/services/smh/smh_client.py +13 -1
  183. tccli/services/smop/smop_client.py +13 -1
  184. tccli/services/smpn/smpn_client.py +13 -1
  185. tccli/services/sms/sms_client.py +13 -1
  186. tccli/services/soe/soe_client.py +13 -1
  187. tccli/services/solar/solar_client.py +13 -1
  188. tccli/services/sqlserver/sqlserver_client.py +13 -1
  189. tccli/services/ssa/ssa_client.py +13 -1
  190. tccli/services/ssl/ssl_client.py +13 -1
  191. tccli/services/sslpod/sslpod_client.py +13 -1
  192. tccli/services/ssm/ssm_client.py +13 -1
  193. tccli/services/sts/sts_client.py +13 -1
  194. tccli/services/svp/svp_client.py +13 -1
  195. tccli/services/taf/taf_client.py +13 -1
  196. tccli/services/tag/tag_client.py +13 -1
  197. tccli/services/tan/tan_client.py +13 -1
  198. tccli/services/tat/tat_client.py +13 -1
  199. tccli/services/tav/tav_client.py +13 -1
  200. tccli/services/tbaas/tbaas_client.py +13 -1
  201. tccli/services/tbm/tbm_client.py +13 -1
  202. tccli/services/tbp/tbp_client.py +13 -1
  203. tccli/services/tcaplusdb/tcaplusdb_client.py +13 -1
  204. tccli/services/tcb/tcb_client.py +13 -1
  205. tccli/services/tcbr/tcbr_client.py +13 -1
  206. tccli/services/tcex/tcex_client.py +13 -1
  207. tccli/services/tchd/tchd_client.py +13 -1
  208. tccli/services/tci/tci_client.py +13 -1
  209. tccli/services/tcm/tcm_client.py +13 -1
  210. tccli/services/tcr/tcr_client.py +13 -1
  211. tccli/services/tcss/tcss_client.py +13 -1
  212. tccli/services/tdcpg/tdcpg_client.py +13 -1
  213. tccli/services/tdid/tdid_client.py +13 -1
  214. tccli/services/tdmq/tdmq_client.py +13 -1
  215. tccli/services/tds/tds_client.py +13 -1
  216. tccli/services/tem/tem_client.py +13 -1
  217. tccli/services/teo/teo_client.py +13 -1
  218. tccli/services/thpc/thpc_client.py +13 -1
  219. tccli/services/tia/tia_client.py +13 -1
  220. tccli/services/tic/tic_client.py +13 -1
  221. tccli/services/ticm/ticm_client.py +13 -1
  222. tccli/services/tics/tics_client.py +13 -1
  223. tccli/services/tiems/tiems_client.py +13 -1
  224. tccli/services/tiia/tiia_client.py +13 -1
  225. tccli/services/tione/tione_client.py +13 -1
  226. tccli/services/tiw/tiw_client.py +13 -1
  227. tccli/services/tke/tke_client.py +13 -1
  228. tccli/services/tkgdq/tkgdq_client.py +13 -1
  229. tccli/services/tms/tms_client.py +13 -1
  230. tccli/services/tmt/tmt_client.py +13 -1
  231. tccli/services/tourism/tourism_client.py +13 -1
  232. tccli/services/trdp/trdp_client.py +13 -1
  233. tccli/services/trocket/trocket_client.py +13 -1
  234. tccli/services/trp/trp_client.py +13 -1
  235. tccli/services/trro/trro_client.py +13 -1
  236. tccli/services/trtc/trtc_client.py +13 -1
  237. tccli/services/tse/tse_client.py +13 -1
  238. tccli/services/tsf/tsf_client.py +13 -1
  239. tccli/services/tsi/tsi_client.py +13 -1
  240. tccli/services/tsw/tsw_client.py +13 -1
  241. tccli/services/tts/tts_client.py +13 -1
  242. tccli/services/ump/ump_client.py +13 -1
  243. tccli/services/vcg/vcg_client.py +13 -1
  244. tccli/services/vclm/vclm_client.py +13 -1
  245. tccli/services/vdb/vdb_client.py +13 -1
  246. tccli/services/vm/vm_client.py +13 -1
  247. tccli/services/vms/vms_client.py +13 -1
  248. tccli/services/vod/vod_client.py +13 -1
  249. tccli/services/vpc/vpc_client.py +13 -1
  250. tccli/services/vrs/vrs_client.py +13 -1
  251. tccli/services/vtc/vtc_client.py +13 -1
  252. tccli/services/waf/waf_client.py +13 -1
  253. tccli/services/wav/wav_client.py +13 -1
  254. tccli/services/wedata/wedata_client.py +13 -1
  255. tccli/services/weilingwith/weilingwith_client.py +13 -1
  256. tccli/services/wss/wss_client.py +13 -1
  257. tccli/services/yinsuda/yinsuda_client.py +13 -1
  258. tccli/services/youmall/youmall_client.py +13 -1
  259. tccli/services/yunjing/yunjing_client.py +13 -1
  260. tccli/services/yunsou/yunsou_client.py +13 -1
  261. tccli/utils.py +8 -0
  262. {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/METADATA +2 -2
  263. {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/RECORD +266 -266
  264. {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/WHEEL +0 -0
  265. {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/entry_points.txt +0 -0
  266. {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/license_files/LICENSE +0 -0
@@ -154,7 +154,13 @@ def action_caller():
154
154
 
155
155
  def parse_global_arg(parsed_globals):
156
156
  g_param = parsed_globals
157
-
157
+ cvm_role_flag = True
158
+ for param in parsed_globals.keys():
159
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
160
+ OptionsDefine.RoleSessionName]:
161
+ if parsed_globals[param] is not None:
162
+ cvm_role_flag = False
163
+ break
158
164
  is_exist_profile = True
159
165
  if not parsed_globals["profile"]:
160
166
  is_exist_profile = False
@@ -185,6 +191,7 @@ def parse_global_arg(parsed_globals):
185
191
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
186
192
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
187
193
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
194
+ cvm_role_flag = False
188
195
 
189
196
  if os.environ.get(OptionsDefine.ENV_REGION):
190
197
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -192,6 +199,11 @@ def parse_global_arg(parsed_globals):
192
199
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
193
200
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
194
201
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
202
+ cvm_role_flag = False
203
+
204
+ if cvm_role_flag:
205
+ if "type" in cred and cred["type"] == "cvm-role":
206
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
195
207
 
196
208
  for param in g_param.keys():
197
209
  if g_param[param] is None:
@@ -308,7 +308,13 @@ def action_caller():
308
308
 
309
309
  def parse_global_arg(parsed_globals):
310
310
  g_param = parsed_globals
311
-
311
+ cvm_role_flag = True
312
+ for param in parsed_globals.keys():
313
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
314
+ OptionsDefine.RoleSessionName]:
315
+ if parsed_globals[param] is not None:
316
+ cvm_role_flag = False
317
+ break
312
318
  is_exist_profile = True
313
319
  if not parsed_globals["profile"]:
314
320
  is_exist_profile = False
@@ -339,6 +345,7 @@ def parse_global_arg(parsed_globals):
339
345
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
340
346
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
341
347
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
348
+ cvm_role_flag = False
342
349
 
343
350
  if os.environ.get(OptionsDefine.ENV_REGION):
344
351
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -346,6 +353,11 @@ def parse_global_arg(parsed_globals):
346
353
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
347
354
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
348
355
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
356
+ cvm_role_flag = False
357
+
358
+ if cvm_role_flag:
359
+ if "type" in cred and cred["type"] == "cvm-role":
360
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
349
361
 
350
362
  for param in g_param.keys():
351
363
  if g_param[param] is None:
@@ -2428,7 +2428,13 @@ def action_caller():
2428
2428
 
2429
2429
  def parse_global_arg(parsed_globals):
2430
2430
  g_param = parsed_globals
2431
-
2431
+ cvm_role_flag = True
2432
+ for param in parsed_globals.keys():
2433
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
2434
+ OptionsDefine.RoleSessionName]:
2435
+ if parsed_globals[param] is not None:
2436
+ cvm_role_flag = False
2437
+ break
2432
2438
  is_exist_profile = True
2433
2439
  if not parsed_globals["profile"]:
2434
2440
  is_exist_profile = False
@@ -2459,6 +2465,7 @@ def parse_global_arg(parsed_globals):
2459
2465
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
2460
2466
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
2461
2467
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
2468
+ cvm_role_flag = False
2462
2469
 
2463
2470
  if os.environ.get(OptionsDefine.ENV_REGION):
2464
2471
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -2466,6 +2473,11 @@ def parse_global_arg(parsed_globals):
2466
2473
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
2467
2474
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
2468
2475
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
2476
+ cvm_role_flag = False
2477
+
2478
+ if cvm_role_flag:
2479
+ if "type" in cred and cred["type"] == "cvm-role":
2480
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
2469
2481
 
2470
2482
  for param in g_param.keys():
2471
2483
  if g_param[param] is None:
@@ -4606,7 +4606,13 @@ def action_caller():
4606
4606
 
4607
4607
  def parse_global_arg(parsed_globals):
4608
4608
  g_param = parsed_globals
4609
-
4609
+ cvm_role_flag = True
4610
+ for param in parsed_globals.keys():
4611
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
4612
+ OptionsDefine.RoleSessionName]:
4613
+ if parsed_globals[param] is not None:
4614
+ cvm_role_flag = False
4615
+ break
4610
4616
  is_exist_profile = True
4611
4617
  if not parsed_globals["profile"]:
4612
4618
  is_exist_profile = False
@@ -4637,6 +4643,7 @@ def parse_global_arg(parsed_globals):
4637
4643
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
4638
4644
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
4639
4645
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
4646
+ cvm_role_flag = False
4640
4647
 
4641
4648
  if os.environ.get(OptionsDefine.ENV_REGION):
4642
4649
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -4644,6 +4651,11 @@ def parse_global_arg(parsed_globals):
4644
4651
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
4645
4652
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
4646
4653
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
4654
+ cvm_role_flag = False
4655
+
4656
+ if cvm_role_flag:
4657
+ if "type" in cred and cred["type"] == "cvm-role":
4658
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
4647
4659
 
4648
4660
  for param in g_param.keys():
4649
4661
  if g_param[param] is None:
@@ -7728,7 +7728,13 @@ def action_caller():
7728
7728
 
7729
7729
  def parse_global_arg(parsed_globals):
7730
7730
  g_param = parsed_globals
7731
-
7731
+ cvm_role_flag = True
7732
+ for param in parsed_globals.keys():
7733
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
7734
+ OptionsDefine.RoleSessionName]:
7735
+ if parsed_globals[param] is not None:
7736
+ cvm_role_flag = False
7737
+ break
7732
7738
  is_exist_profile = True
7733
7739
  if not parsed_globals["profile"]:
7734
7740
  is_exist_profile = False
@@ -7759,6 +7765,7 @@ def parse_global_arg(parsed_globals):
7759
7765
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
7760
7766
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
7761
7767
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
7768
+ cvm_role_flag = False
7762
7769
 
7763
7770
  if os.environ.get(OptionsDefine.ENV_REGION):
7764
7771
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -7766,6 +7773,11 @@ def parse_global_arg(parsed_globals):
7766
7773
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
7767
7774
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
7768
7775
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
7776
+ cvm_role_flag = False
7777
+
7778
+ if cvm_role_flag:
7779
+ if "type" in cred and cred["type"] == "cvm-role":
7780
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
7769
7781
 
7770
7782
  for param in g_param.keys():
7771
7783
  if g_param[param] is None:
@@ -520,7 +520,13 @@ def action_caller():
520
520
 
521
521
  def parse_global_arg(parsed_globals):
522
522
  g_param = parsed_globals
523
-
523
+ cvm_role_flag = True
524
+ for param in parsed_globals.keys():
525
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
526
+ OptionsDefine.RoleSessionName]:
527
+ if parsed_globals[param] is not None:
528
+ cvm_role_flag = False
529
+ break
524
530
  is_exist_profile = True
525
531
  if not parsed_globals["profile"]:
526
532
  is_exist_profile = False
@@ -551,6 +557,7 @@ def parse_global_arg(parsed_globals):
551
557
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
552
558
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
553
559
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
560
+ cvm_role_flag = False
554
561
 
555
562
  if os.environ.get(OptionsDefine.ENV_REGION):
556
563
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -558,6 +565,11 @@ def parse_global_arg(parsed_globals):
558
565
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
559
566
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
560
567
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
568
+ cvm_role_flag = False
569
+
570
+ if cvm_role_flag:
571
+ if "type" in cred and cred["type"] == "cvm-role":
572
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
561
573
 
562
574
  for param in g_param.keys():
563
575
  if g_param[param] is None:
@@ -8586,7 +8586,13 @@ def action_caller():
8586
8586
 
8587
8587
  def parse_global_arg(parsed_globals):
8588
8588
  g_param = parsed_globals
8589
-
8589
+ cvm_role_flag = True
8590
+ for param in parsed_globals.keys():
8591
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
8592
+ OptionsDefine.RoleSessionName]:
8593
+ if parsed_globals[param] is not None:
8594
+ cvm_role_flag = False
8595
+ break
8590
8596
  is_exist_profile = True
8591
8597
  if not parsed_globals["profile"]:
8592
8598
  is_exist_profile = False
@@ -8617,6 +8623,7 @@ def parse_global_arg(parsed_globals):
8617
8623
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
8618
8624
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
8619
8625
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
8626
+ cvm_role_flag = False
8620
8627
 
8621
8628
  if os.environ.get(OptionsDefine.ENV_REGION):
8622
8629
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -8624,6 +8631,11 @@ def parse_global_arg(parsed_globals):
8624
8631
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
8625
8632
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
8626
8633
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
8634
+ cvm_role_flag = False
8635
+
8636
+ if cvm_role_flag:
8637
+ if "type" in cred and cred["type"] == "cvm-role":
8638
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
8627
8639
 
8628
8640
  for param in g_param.keys():
8629
8641
  if g_param[param] is None:
@@ -5555,7 +5555,13 @@ def action_caller():
5555
5555
 
5556
5556
  def parse_global_arg(parsed_globals):
5557
5557
  g_param = parsed_globals
5558
-
5558
+ cvm_role_flag = True
5559
+ for param in parsed_globals.keys():
5560
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
5561
+ OptionsDefine.RoleSessionName]:
5562
+ if parsed_globals[param] is not None:
5563
+ cvm_role_flag = False
5564
+ break
5559
5565
  is_exist_profile = True
5560
5566
  if not parsed_globals["profile"]:
5561
5567
  is_exist_profile = False
@@ -5586,6 +5592,7 @@ def parse_global_arg(parsed_globals):
5586
5592
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
5587
5593
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
5588
5594
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
5595
+ cvm_role_flag = False
5589
5596
 
5590
5597
  if os.environ.get(OptionsDefine.ENV_REGION):
5591
5598
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -5593,6 +5600,11 @@ def parse_global_arg(parsed_globals):
5593
5600
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
5594
5601
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
5595
5602
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
5603
+ cvm_role_flag = False
5604
+
5605
+ if cvm_role_flag:
5606
+ if "type" in cred and cred["type"] == "cvm-role":
5607
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
5596
5608
 
5597
5609
  for param in g_param.keys():
5598
5610
  if g_param[param] is None:
@@ -631,7 +631,13 @@ def action_caller():
631
631
 
632
632
  def parse_global_arg(parsed_globals):
633
633
  g_param = parsed_globals
634
-
634
+ cvm_role_flag = True
635
+ for param in parsed_globals.keys():
636
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
637
+ OptionsDefine.RoleSessionName]:
638
+ if parsed_globals[param] is not None:
639
+ cvm_role_flag = False
640
+ break
635
641
  is_exist_profile = True
636
642
  if not parsed_globals["profile"]:
637
643
  is_exist_profile = False
@@ -662,6 +668,7 @@ def parse_global_arg(parsed_globals):
662
668
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
663
669
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
664
670
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
671
+ cvm_role_flag = False
665
672
 
666
673
  if os.environ.get(OptionsDefine.ENV_REGION):
667
674
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -669,6 +676,11 @@ def parse_global_arg(parsed_globals):
669
676
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
670
677
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
671
678
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
679
+ cvm_role_flag = False
680
+
681
+ if cvm_role_flag:
682
+ if "type" in cred and cred["type"] == "cvm-role":
683
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
672
684
 
673
685
  for param in g_param.keys():
674
686
  if g_param[param] is None:
@@ -4495,7 +4495,13 @@ def action_caller():
4495
4495
 
4496
4496
  def parse_global_arg(parsed_globals):
4497
4497
  g_param = parsed_globals
4498
-
4498
+ cvm_role_flag = True
4499
+ for param in parsed_globals.keys():
4500
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
4501
+ OptionsDefine.RoleSessionName]:
4502
+ if parsed_globals[param] is not None:
4503
+ cvm_role_flag = False
4504
+ break
4499
4505
  is_exist_profile = True
4500
4506
  if not parsed_globals["profile"]:
4501
4507
  is_exist_profile = False
@@ -4526,6 +4532,7 @@ def parse_global_arg(parsed_globals):
4526
4532
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
4527
4533
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
4528
4534
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
4535
+ cvm_role_flag = False
4529
4536
 
4530
4537
  if os.environ.get(OptionsDefine.ENV_REGION):
4531
4538
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -4533,6 +4540,11 @@ def parse_global_arg(parsed_globals):
4533
4540
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
4534
4541
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
4535
4542
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
4543
+ cvm_role_flag = False
4544
+
4545
+ if cvm_role_flag:
4546
+ if "type" in cred and cred["type"] == "cvm-role":
4547
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
4536
4548
 
4537
4549
  for param in g_param.keys():
4538
4550
  if g_param[param] is None:
@@ -1527,7 +1527,13 @@ def action_caller():
1527
1527
 
1528
1528
  def parse_global_arg(parsed_globals):
1529
1529
  g_param = parsed_globals
1530
-
1530
+ cvm_role_flag = True
1531
+ for param in parsed_globals.keys():
1532
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
1533
+ OptionsDefine.RoleSessionName]:
1534
+ if parsed_globals[param] is not None:
1535
+ cvm_role_flag = False
1536
+ break
1531
1537
  is_exist_profile = True
1532
1538
  if not parsed_globals["profile"]:
1533
1539
  is_exist_profile = False
@@ -1558,6 +1564,7 @@ def parse_global_arg(parsed_globals):
1558
1564
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
1559
1565
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
1560
1566
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
1567
+ cvm_role_flag = False
1561
1568
 
1562
1569
  if os.environ.get(OptionsDefine.ENV_REGION):
1563
1570
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -1565,6 +1572,11 @@ def parse_global_arg(parsed_globals):
1565
1572
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
1566
1573
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
1567
1574
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
1575
+ cvm_role_flag = False
1576
+
1577
+ if cvm_role_flag:
1578
+ if "type" in cred and cred["type"] == "cvm-role":
1579
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
1568
1580
 
1569
1581
  for param in g_param.keys():
1570
1582
  if g_param[param] is None:
@@ -2057,7 +2057,13 @@ def action_caller():
2057
2057
 
2058
2058
  def parse_global_arg(parsed_globals):
2059
2059
  g_param = parsed_globals
2060
-
2060
+ cvm_role_flag = True
2061
+ for param in parsed_globals.keys():
2062
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
2063
+ OptionsDefine.RoleSessionName]:
2064
+ if parsed_globals[param] is not None:
2065
+ cvm_role_flag = False
2066
+ break
2061
2067
  is_exist_profile = True
2062
2068
  if not parsed_globals["profile"]:
2063
2069
  is_exist_profile = False
@@ -2088,6 +2094,7 @@ def parse_global_arg(parsed_globals):
2088
2094
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
2089
2095
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
2090
2096
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
2097
+ cvm_role_flag = False
2091
2098
 
2092
2099
  if os.environ.get(OptionsDefine.ENV_REGION):
2093
2100
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -2095,6 +2102,11 @@ def parse_global_arg(parsed_globals):
2095
2102
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
2096
2103
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
2097
2104
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
2105
+ cvm_role_flag = False
2106
+
2107
+ if cvm_role_flag:
2108
+ if "type" in cred and cred["type"] == "cvm-role":
2109
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
2098
2110
 
2099
2111
  for param in g_param.keys():
2100
2112
  if g_param[param] is None:
@@ -2852,7 +2852,13 @@ def action_caller():
2852
2852
 
2853
2853
  def parse_global_arg(parsed_globals):
2854
2854
  g_param = parsed_globals
2855
-
2855
+ cvm_role_flag = True
2856
+ for param in parsed_globals.keys():
2857
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
2858
+ OptionsDefine.RoleSessionName]:
2859
+ if parsed_globals[param] is not None:
2860
+ cvm_role_flag = False
2861
+ break
2856
2862
  is_exist_profile = True
2857
2863
  if not parsed_globals["profile"]:
2858
2864
  is_exist_profile = False
@@ -2883,6 +2889,7 @@ def parse_global_arg(parsed_globals):
2883
2889
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
2884
2890
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
2885
2891
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
2892
+ cvm_role_flag = False
2886
2893
 
2887
2894
  if os.environ.get(OptionsDefine.ENV_REGION):
2888
2895
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -2890,6 +2897,11 @@ def parse_global_arg(parsed_globals):
2890
2897
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
2891
2898
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
2892
2899
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
2900
+ cvm_role_flag = False
2901
+
2902
+ if cvm_role_flag:
2903
+ if "type" in cred and cred["type"] == "cvm-role":
2904
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
2893
2905
 
2894
2906
  for param in g_param.keys():
2895
2907
  if g_param[param] is None:
@@ -3488,7 +3488,13 @@ def action_caller():
3488
3488
 
3489
3489
  def parse_global_arg(parsed_globals):
3490
3490
  g_param = parsed_globals
3491
-
3491
+ cvm_role_flag = True
3492
+ for param in parsed_globals.keys():
3493
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
3494
+ OptionsDefine.RoleSessionName]:
3495
+ if parsed_globals[param] is not None:
3496
+ cvm_role_flag = False
3497
+ break
3492
3498
  is_exist_profile = True
3493
3499
  if not parsed_globals["profile"]:
3494
3500
  is_exist_profile = False
@@ -3519,6 +3525,7 @@ def parse_global_arg(parsed_globals):
3519
3525
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
3520
3526
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
3521
3527
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
3528
+ cvm_role_flag = False
3522
3529
 
3523
3530
  if os.environ.get(OptionsDefine.ENV_REGION):
3524
3531
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -3526,6 +3533,11 @@ def parse_global_arg(parsed_globals):
3526
3533
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
3527
3534
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
3528
3535
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
3536
+ cvm_role_flag = False
3537
+
3538
+ if cvm_role_flag:
3539
+ if "type" in cred and cred["type"] == "cvm-role":
3540
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
3529
3541
 
3530
3542
  for param in g_param.keys():
3531
3543
  if g_param[param] is None:
@@ -5820,7 +5820,13 @@ def action_caller():
5820
5820
 
5821
5821
  def parse_global_arg(parsed_globals):
5822
5822
  g_param = parsed_globals
5823
-
5823
+ cvm_role_flag = True
5824
+ for param in parsed_globals.keys():
5825
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
5826
+ OptionsDefine.RoleSessionName]:
5827
+ if parsed_globals[param] is not None:
5828
+ cvm_role_flag = False
5829
+ break
5824
5830
  is_exist_profile = True
5825
5831
  if not parsed_globals["profile"]:
5826
5832
  is_exist_profile = False
@@ -5851,6 +5857,7 @@ def parse_global_arg(parsed_globals):
5851
5857
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
5852
5858
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
5853
5859
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
5860
+ cvm_role_flag = False
5854
5861
 
5855
5862
  if os.environ.get(OptionsDefine.ENV_REGION):
5856
5863
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -5858,6 +5865,11 @@ def parse_global_arg(parsed_globals):
5858
5865
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
5859
5866
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
5860
5867
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
5868
+ cvm_role_flag = False
5869
+
5870
+ if cvm_role_flag:
5871
+ if "type" in cred and cred["type"] == "cvm-role":
5872
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
5861
5873
 
5862
5874
  for param in g_param.keys():
5863
5875
  if g_param[param] is None:
@@ -8470,7 +8470,13 @@ def action_caller():
8470
8470
 
8471
8471
  def parse_global_arg(parsed_globals):
8472
8472
  g_param = parsed_globals
8473
-
8473
+ cvm_role_flag = True
8474
+ for param in parsed_globals.keys():
8475
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
8476
+ OptionsDefine.RoleSessionName]:
8477
+ if parsed_globals[param] is not None:
8478
+ cvm_role_flag = False
8479
+ break
8474
8480
  is_exist_profile = True
8475
8481
  if not parsed_globals["profile"]:
8476
8482
  is_exist_profile = False
@@ -8501,6 +8507,7 @@ def parse_global_arg(parsed_globals):
8501
8507
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
8502
8508
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
8503
8509
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
8510
+ cvm_role_flag = False
8504
8511
 
8505
8512
  if os.environ.get(OptionsDefine.ENV_REGION):
8506
8513
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -8508,6 +8515,11 @@ def parse_global_arg(parsed_globals):
8508
8515
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
8509
8516
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
8510
8517
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
8518
+ cvm_role_flag = False
8519
+
8520
+ if cvm_role_flag:
8521
+ if "type" in cred and cred["type"] == "cvm-role":
8522
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
8511
8523
 
8512
8524
  for param in g_param.keys():
8513
8525
  if g_param[param] is None:
@@ -4813,7 +4813,13 @@ def action_caller():
4813
4813
 
4814
4814
  def parse_global_arg(parsed_globals):
4815
4815
  g_param = parsed_globals
4816
-
4816
+ cvm_role_flag = True
4817
+ for param in parsed_globals.keys():
4818
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
4819
+ OptionsDefine.RoleSessionName]:
4820
+ if parsed_globals[param] is not None:
4821
+ cvm_role_flag = False
4822
+ break
4817
4823
  is_exist_profile = True
4818
4824
  if not parsed_globals["profile"]:
4819
4825
  is_exist_profile = False
@@ -4844,6 +4850,7 @@ def parse_global_arg(parsed_globals):
4844
4850
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
4845
4851
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
4846
4852
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
4853
+ cvm_role_flag = False
4847
4854
 
4848
4855
  if os.environ.get(OptionsDefine.ENV_REGION):
4849
4856
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -4851,6 +4858,11 @@ def parse_global_arg(parsed_globals):
4851
4858
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
4852
4859
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
4853
4860
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
4861
+ cvm_role_flag = False
4862
+
4863
+ if cvm_role_flag:
4864
+ if "type" in cred and cred["type"] == "cvm-role":
4865
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
4854
4866
 
4855
4867
  for param in g_param.keys():
4856
4868
  if g_param[param] is None:
@@ -96,7 +96,13 @@ def action_caller():
96
96
 
97
97
  def parse_global_arg(parsed_globals):
98
98
  g_param = parsed_globals
99
-
99
+ cvm_role_flag = True
100
+ for param in parsed_globals.keys():
101
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
102
+ OptionsDefine.RoleSessionName]:
103
+ if parsed_globals[param] is not None:
104
+ cvm_role_flag = False
105
+ break
100
106
  is_exist_profile = True
101
107
  if not parsed_globals["profile"]:
102
108
  is_exist_profile = False
@@ -127,6 +133,7 @@ def parse_global_arg(parsed_globals):
127
133
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
128
134
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
129
135
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
136
+ cvm_role_flag = False
130
137
 
131
138
  if os.environ.get(OptionsDefine.ENV_REGION):
132
139
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -134,6 +141,11 @@ def parse_global_arg(parsed_globals):
134
141
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
135
142
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
136
143
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
144
+ cvm_role_flag = False
145
+
146
+ if cvm_role_flag:
147
+ if "type" in cred and cred["type"] == "cvm-role":
148
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
137
149
 
138
150
  for param in g_param.keys():
139
151
  if g_param[param] is None: