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
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1217.1'
1
+ __version__ = '3.0.1218.1'
tccli/command.py CHANGED
@@ -326,4 +326,3 @@ class ActionCommand(BaseCommand):
326
326
  def _create_action_parser(self, argument_map):
327
327
  parser = ArgMapArgParser(argument_map)
328
328
  return parser
329
-
tccli/configure.py CHANGED
@@ -28,7 +28,7 @@ class BasicConfigure(BasicCommand):
28
28
  OptionsDefine.Language
29
29
  ]
30
30
  self.cred_list = [OptionsDefine.SecretId, OptionsDefine.SecretKey, OptionsDefine.Token,
31
- OptionsDefine.RoleArn, OptionsDefine.RoleSessionName]
31
+ OptionsDefine.RoleArn, OptionsDefine.RoleSessionName, OptionsDefine.UseCVMRole]
32
32
  self.conf_service_list = [OptionsDefine.Version, OptionsDefine.Endpoint]
33
33
  self.cli_path = os.path.join(os.path.expanduser("~"), ".tccli")
34
34
  self._cli_data = Loader()
@@ -211,6 +211,16 @@ class ConfigureSetCommand(BasicConfigure):
211
211
 
212
212
  for varname, value in zip(varnames, values):
213
213
  if varname in self.cred_list:
214
+ if varname == OptionsDefine.UseCVMRole:
215
+ identifier, bool_value = Utils.is_bool(value)
216
+ if identifier:
217
+ if bool_value:
218
+ cred["type"] = 'cvm-role'
219
+ else:
220
+ cred["type"] = 'default'
221
+ else:
222
+ raise ParamError("use-cvm-role must be true or false")
223
+ continue
214
224
  cred[varname] = value
215
225
  elif varname in self.config_list:
216
226
  if varname == OptionsDefine.Output and value not in ['json', 'text', 'table']:
@@ -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:
@@ -255,7 +255,13 @@ def action_caller():
255
255
 
256
256
  def parse_global_arg(parsed_globals):
257
257
  g_param = parsed_globals
258
-
258
+ cvm_role_flag = True
259
+ for param in parsed_globals.keys():
260
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
261
+ OptionsDefine.RoleSessionName]:
262
+ if parsed_globals[param] is not None:
263
+ cvm_role_flag = False
264
+ break
259
265
  is_exist_profile = True
260
266
  if not parsed_globals["profile"]:
261
267
  is_exist_profile = False
@@ -286,6 +292,7 @@ def parse_global_arg(parsed_globals):
286
292
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
287
293
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
288
294
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
295
+ cvm_role_flag = False
289
296
 
290
297
  if os.environ.get(OptionsDefine.ENV_REGION):
291
298
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -293,6 +300,11 @@ def parse_global_arg(parsed_globals):
293
300
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
294
301
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
295
302
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
303
+ cvm_role_flag = False
304
+
305
+ if cvm_role_flag:
306
+ if "type" in cred and cred["type"] == "cvm-role":
307
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
296
308
 
297
309
  for param in g_param.keys():
298
310
  if g_param[param] is None:
@@ -467,7 +467,13 @@ def action_caller():
467
467
 
468
468
  def parse_global_arg(parsed_globals):
469
469
  g_param = parsed_globals
470
-
470
+ cvm_role_flag = True
471
+ for param in parsed_globals.keys():
472
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
473
+ OptionsDefine.RoleSessionName]:
474
+ if parsed_globals[param] is not None:
475
+ cvm_role_flag = False
476
+ break
471
477
  is_exist_profile = True
472
478
  if not parsed_globals["profile"]:
473
479
  is_exist_profile = False
@@ -498,6 +504,7 @@ def parse_global_arg(parsed_globals):
498
504
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
499
505
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
500
506
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
507
+ cvm_role_flag = False
501
508
 
502
509
  if os.environ.get(OptionsDefine.ENV_REGION):
503
510
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -505,6 +512,11 @@ def parse_global_arg(parsed_globals):
505
512
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
506
513
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
507
514
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
515
+ cvm_role_flag = False
516
+
517
+ if cvm_role_flag:
518
+ if "type" in cred and cred["type"] == "cvm-role":
519
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
508
520
 
509
521
  for param in g_param.keys():
510
522
  if g_param[param] is None:
@@ -149,7 +149,13 @@ def action_caller():
149
149
 
150
150
  def parse_global_arg(parsed_globals):
151
151
  g_param = parsed_globals
152
-
152
+ cvm_role_flag = True
153
+ for param in parsed_globals.keys():
154
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
155
+ OptionsDefine.RoleSessionName]:
156
+ if parsed_globals[param] is not None:
157
+ cvm_role_flag = False
158
+ break
153
159
  is_exist_profile = True
154
160
  if not parsed_globals["profile"]:
155
161
  is_exist_profile = False
@@ -180,6 +186,7 @@ def parse_global_arg(parsed_globals):
180
186
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
181
187
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
182
188
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
189
+ cvm_role_flag = False
183
190
 
184
191
  if os.environ.get(OptionsDefine.ENV_REGION):
185
192
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -187,6 +194,11 @@ def parse_global_arg(parsed_globals):
187
194
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
188
195
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
189
196
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
197
+ cvm_role_flag = False
198
+
199
+ if cvm_role_flag:
200
+ if "type" in cred and cred["type"] == "cvm-role":
201
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
190
202
 
191
203
  for param in g_param.keys():
192
204
  if g_param[param] is None:
@@ -202,7 +202,13 @@ def action_caller():
202
202
 
203
203
  def parse_global_arg(parsed_globals):
204
204
  g_param = parsed_globals
205
-
205
+ cvm_role_flag = True
206
+ for param in parsed_globals.keys():
207
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
208
+ OptionsDefine.RoleSessionName]:
209
+ if parsed_globals[param] is not None:
210
+ cvm_role_flag = False
211
+ break
206
212
  is_exist_profile = True
207
213
  if not parsed_globals["profile"]:
208
214
  is_exist_profile = False
@@ -233,6 +239,7 @@ def parse_global_arg(parsed_globals):
233
239
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
234
240
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
235
241
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
242
+ cvm_role_flag = False
236
243
 
237
244
  if os.environ.get(OptionsDefine.ENV_REGION):
238
245
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -240,6 +247,11 @@ def parse_global_arg(parsed_globals):
240
247
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
241
248
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
242
249
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
250
+ cvm_role_flag = False
251
+
252
+ if cvm_role_flag:
253
+ if "type" in cred and cred["type"] == "cvm-role":
254
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
243
255
 
244
256
  for param in g_param.keys():
245
257
  if g_param[param] is None:
@@ -202,7 +202,13 @@ def action_caller():
202
202
 
203
203
  def parse_global_arg(parsed_globals):
204
204
  g_param = parsed_globals
205
-
205
+ cvm_role_flag = True
206
+ for param in parsed_globals.keys():
207
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
208
+ OptionsDefine.RoleSessionName]:
209
+ if parsed_globals[param] is not None:
210
+ cvm_role_flag = False
211
+ break
206
212
  is_exist_profile = True
207
213
  if not parsed_globals["profile"]:
208
214
  is_exist_profile = False
@@ -233,6 +239,7 @@ def parse_global_arg(parsed_globals):
233
239
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
234
240
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
235
241
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
242
+ cvm_role_flag = False
236
243
 
237
244
  if os.environ.get(OptionsDefine.ENV_REGION):
238
245
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -240,6 +247,11 @@ def parse_global_arg(parsed_globals):
240
247
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
241
248
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
242
249
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
250
+ cvm_role_flag = False
251
+
252
+ if cvm_role_flag:
253
+ if "type" in cred and cred["type"] == "cvm-role":
254
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
243
255
 
244
256
  for param in g_param.keys():
245
257
  if g_param[param] is None:
@@ -732,7 +732,13 @@ def action_caller():
732
732
 
733
733
  def parse_global_arg(parsed_globals):
734
734
  g_param = parsed_globals
735
-
735
+ cvm_role_flag = True
736
+ for param in parsed_globals.keys():
737
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
738
+ OptionsDefine.RoleSessionName]:
739
+ if parsed_globals[param] is not None:
740
+ cvm_role_flag = False
741
+ break
736
742
  is_exist_profile = True
737
743
  if not parsed_globals["profile"]:
738
744
  is_exist_profile = False
@@ -763,6 +769,7 @@ def parse_global_arg(parsed_globals):
763
769
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
764
770
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
765
771
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
772
+ cvm_role_flag = False
766
773
 
767
774
  if os.environ.get(OptionsDefine.ENV_REGION):
768
775
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -770,6 +777,11 @@ def parse_global_arg(parsed_globals):
770
777
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
771
778
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
772
779
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
780
+ cvm_role_flag = False
781
+
782
+ if cvm_role_flag:
783
+ if "type" in cred and cred["type"] == "cvm-role":
784
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
773
785
 
774
786
  for param in g_param.keys():
775
787
  if g_param[param] is None:
@@ -1686,7 +1686,13 @@ def action_caller():
1686
1686
 
1687
1687
  def parse_global_arg(parsed_globals):
1688
1688
  g_param = parsed_globals
1689
-
1689
+ cvm_role_flag = True
1690
+ for param in parsed_globals.keys():
1691
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
1692
+ OptionsDefine.RoleSessionName]:
1693
+ if parsed_globals[param] is not None:
1694
+ cvm_role_flag = False
1695
+ break
1690
1696
  is_exist_profile = True
1691
1697
  if not parsed_globals["profile"]:
1692
1698
  is_exist_profile = False
@@ -1717,6 +1723,7 @@ def parse_global_arg(parsed_globals):
1717
1723
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
1718
1724
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
1719
1725
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
1726
+ cvm_role_flag = False
1720
1727
 
1721
1728
  if os.environ.get(OptionsDefine.ENV_REGION):
1722
1729
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -1724,6 +1731,11 @@ def parse_global_arg(parsed_globals):
1724
1731
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
1725
1732
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
1726
1733
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
1734
+ cvm_role_flag = False
1735
+
1736
+ if cvm_role_flag:
1737
+ if "type" in cred and cred["type"] == "cvm-role":
1738
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
1727
1739
 
1728
1740
  for param in g_param.keys():
1729
1741
  if g_param[param] is None:
@@ -525,7 +525,13 @@ def action_caller():
525
525
 
526
526
  def parse_global_arg(parsed_globals):
527
527
  g_param = parsed_globals
528
-
528
+ cvm_role_flag = True
529
+ for param in parsed_globals.keys():
530
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
531
+ OptionsDefine.RoleSessionName]:
532
+ if parsed_globals[param] is not None:
533
+ cvm_role_flag = False
534
+ break
529
535
  is_exist_profile = True
530
536
  if not parsed_globals["profile"]:
531
537
  is_exist_profile = False
@@ -556,6 +562,7 @@ def parse_global_arg(parsed_globals):
556
562
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
557
563
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
558
564
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
565
+ cvm_role_flag = False
559
566
 
560
567
  if os.environ.get(OptionsDefine.ENV_REGION):
561
568
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -563,6 +570,11 @@ def parse_global_arg(parsed_globals):
563
570
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
564
571
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
565
572
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
573
+ cvm_role_flag = False
574
+
575
+ if cvm_role_flag:
576
+ if "type" in cred and cred["type"] == "cvm-role":
577
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
566
578
 
567
579
  for param in g_param.keys():
568
580
  if g_param[param] is None:
@@ -202,7 +202,13 @@ def action_caller():
202
202
 
203
203
  def parse_global_arg(parsed_globals):
204
204
  g_param = parsed_globals
205
-
205
+ cvm_role_flag = True
206
+ for param in parsed_globals.keys():
207
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
208
+ OptionsDefine.RoleSessionName]:
209
+ if parsed_globals[param] is not None:
210
+ cvm_role_flag = False
211
+ break
206
212
  is_exist_profile = True
207
213
  if not parsed_globals["profile"]:
208
214
  is_exist_profile = False
@@ -233,6 +239,7 @@ def parse_global_arg(parsed_globals):
233
239
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
234
240
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
235
241
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
242
+ cvm_role_flag = False
236
243
 
237
244
  if os.environ.get(OptionsDefine.ENV_REGION):
238
245
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -240,6 +247,11 @@ def parse_global_arg(parsed_globals):
240
247
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
241
248
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
242
249
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
250
+ cvm_role_flag = False
251
+
252
+ if cvm_role_flag:
253
+ if "type" in cred and cred["type"] == "cvm-role":
254
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
243
255
 
244
256
  for param in g_param.keys():
245
257
  if g_param[param] is None:
@@ -5131,7 +5131,13 @@ def action_caller():
5131
5131
 
5132
5132
  def parse_global_arg(parsed_globals):
5133
5133
  g_param = parsed_globals
5134
-
5134
+ cvm_role_flag = True
5135
+ for param in parsed_globals.keys():
5136
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
5137
+ OptionsDefine.RoleSessionName]:
5138
+ if parsed_globals[param] is not None:
5139
+ cvm_role_flag = False
5140
+ break
5135
5141
  is_exist_profile = True
5136
5142
  if not parsed_globals["profile"]:
5137
5143
  is_exist_profile = False
@@ -5162,6 +5168,7 @@ def parse_global_arg(parsed_globals):
5162
5168
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
5163
5169
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
5164
5170
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
5171
+ cvm_role_flag = False
5165
5172
 
5166
5173
  if os.environ.get(OptionsDefine.ENV_REGION):
5167
5174
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -5169,6 +5176,11 @@ def parse_global_arg(parsed_globals):
5169
5176
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
5170
5177
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
5171
5178
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
5179
+ cvm_role_flag = False
5180
+
5181
+ if cvm_role_flag:
5182
+ if "type" in cred and cred["type"] == "cvm-role":
5183
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
5172
5184
 
5173
5185
  for param in g_param.keys():
5174
5186
  if g_param[param] is None:
@@ -414,7 +414,13 @@ def action_caller():
414
414
 
415
415
  def parse_global_arg(parsed_globals):
416
416
  g_param = parsed_globals
417
-
417
+ cvm_role_flag = True
418
+ for param in parsed_globals.keys():
419
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
420
+ OptionsDefine.RoleSessionName]:
421
+ if parsed_globals[param] is not None:
422
+ cvm_role_flag = False
423
+ break
418
424
  is_exist_profile = True
419
425
  if not parsed_globals["profile"]:
420
426
  is_exist_profile = False
@@ -445,6 +451,7 @@ def parse_global_arg(parsed_globals):
445
451
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
446
452
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
447
453
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
454
+ cvm_role_flag = False
448
455
 
449
456
  if os.environ.get(OptionsDefine.ENV_REGION):
450
457
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -452,6 +459,11 @@ def parse_global_arg(parsed_globals):
452
459
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
453
460
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
454
461
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
462
+ cvm_role_flag = False
463
+
464
+ if cvm_role_flag:
465
+ if "type" in cred and cred["type"] == "cvm-role":
466
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
455
467
 
456
468
  for param in g_param.keys():
457
469
  if g_param[param] is None:
@@ -467,7 +467,13 @@ def action_caller():
467
467
 
468
468
  def parse_global_arg(parsed_globals):
469
469
  g_param = parsed_globals
470
-
470
+ cvm_role_flag = True
471
+ for param in parsed_globals.keys():
472
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
473
+ OptionsDefine.RoleSessionName]:
474
+ if parsed_globals[param] is not None:
475
+ cvm_role_flag = False
476
+ break
471
477
  is_exist_profile = True
472
478
  if not parsed_globals["profile"]:
473
479
  is_exist_profile = False
@@ -498,6 +504,7 @@ def parse_global_arg(parsed_globals):
498
504
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
499
505
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
500
506
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
507
+ cvm_role_flag = False
501
508
 
502
509
  if os.environ.get(OptionsDefine.ENV_REGION):
503
510
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -505,6 +512,11 @@ def parse_global_arg(parsed_globals):
505
512
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
506
513
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
507
514
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
515
+ cvm_role_flag = False
516
+
517
+ if cvm_role_flag:
518
+ if "type" in cred and cred["type"] == "cvm-role":
519
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
508
520
 
509
521
  for param in g_param.keys():
510
522
  if g_param[param] is None:
@@ -202,7 +202,13 @@ def action_caller():
202
202
 
203
203
  def parse_global_arg(parsed_globals):
204
204
  g_param = parsed_globals
205
-
205
+ cvm_role_flag = True
206
+ for param in parsed_globals.keys():
207
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
208
+ OptionsDefine.RoleSessionName]:
209
+ if parsed_globals[param] is not None:
210
+ cvm_role_flag = False
211
+ break
206
212
  is_exist_profile = True
207
213
  if not parsed_globals["profile"]:
208
214
  is_exist_profile = False
@@ -233,6 +239,7 @@ def parse_global_arg(parsed_globals):
233
239
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
234
240
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
235
241
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
242
+ cvm_role_flag = False
236
243
 
237
244
  if os.environ.get(OptionsDefine.ENV_REGION):
238
245
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -240,6 +247,11 @@ def parse_global_arg(parsed_globals):
240
247
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
241
248
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
242
249
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
250
+ cvm_role_flag = False
251
+
252
+ if cvm_role_flag:
253
+ if "type" in cred and cred["type"] == "cvm-role":
254
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
243
255
 
244
256
  for param in g_param.keys():
245
257
  if g_param[param] is None:
@@ -5184,7 +5184,13 @@ def action_caller():
5184
5184
 
5185
5185
  def parse_global_arg(parsed_globals):
5186
5186
  g_param = parsed_globals
5187
-
5187
+ cvm_role_flag = True
5188
+ for param in parsed_globals.keys():
5189
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
5190
+ OptionsDefine.RoleSessionName]:
5191
+ if parsed_globals[param] is not None:
5192
+ cvm_role_flag = False
5193
+ break
5188
5194
  is_exist_profile = True
5189
5195
  if not parsed_globals["profile"]:
5190
5196
  is_exist_profile = False
@@ -5215,6 +5221,7 @@ def parse_global_arg(parsed_globals):
5215
5221
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
5216
5222
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
5217
5223
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
5224
+ cvm_role_flag = False
5218
5225
 
5219
5226
  if os.environ.get(OptionsDefine.ENV_REGION):
5220
5227
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -5222,6 +5229,11 @@ def parse_global_arg(parsed_globals):
5222
5229
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
5223
5230
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
5224
5231
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
5232
+ cvm_role_flag = False
5233
+
5234
+ if cvm_role_flag:
5235
+ if "type" in cred and cred["type"] == "cvm-role":
5236
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
5225
5237
 
5226
5238
  for param in g_param.keys():
5227
5239
  if g_param[param] is None:
@@ -679,7 +679,13 @@ def action_caller():
679
679
 
680
680
  def parse_global_arg(parsed_globals):
681
681
  g_param = parsed_globals
682
-
682
+ cvm_role_flag = True
683
+ for param in parsed_globals.keys():
684
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
685
+ OptionsDefine.RoleSessionName]:
686
+ if parsed_globals[param] is not None:
687
+ cvm_role_flag = False
688
+ break
683
689
  is_exist_profile = True
684
690
  if not parsed_globals["profile"]:
685
691
  is_exist_profile = False
@@ -710,6 +716,7 @@ def parse_global_arg(parsed_globals):
710
716
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
711
717
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
712
718
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
719
+ cvm_role_flag = False
713
720
 
714
721
  if os.environ.get(OptionsDefine.ENV_REGION):
715
722
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -717,6 +724,11 @@ def parse_global_arg(parsed_globals):
717
724
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
718
725
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
719
726
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
727
+ cvm_role_flag = False
728
+
729
+ if cvm_role_flag:
730
+ if "type" in cred and cred["type"] == "cvm-role":
731
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
720
732
 
721
733
  for param in g_param.keys():
722
734
  if g_param[param] is None:
@@ -1739,7 +1739,13 @@ def action_caller():
1739
1739
 
1740
1740
  def parse_global_arg(parsed_globals):
1741
1741
  g_param = parsed_globals
1742
-
1742
+ cvm_role_flag = True
1743
+ for param in parsed_globals.keys():
1744
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
1745
+ OptionsDefine.RoleSessionName]:
1746
+ if parsed_globals[param] is not None:
1747
+ cvm_role_flag = False
1748
+ break
1743
1749
  is_exist_profile = True
1744
1750
  if not parsed_globals["profile"]:
1745
1751
  is_exist_profile = False
@@ -1770,6 +1776,7 @@ def parse_global_arg(parsed_globals):
1770
1776
  cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
1771
1777
  cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
1772
1778
  cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
1779
+ cvm_role_flag = False
1773
1780
 
1774
1781
  if os.environ.get(OptionsDefine.ENV_REGION):
1775
1782
  conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
@@ -1777,6 +1784,11 @@ def parse_global_arg(parsed_globals):
1777
1784
  if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
1778
1785
  cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
1779
1786
  cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
1787
+ cvm_role_flag = False
1788
+
1789
+ if cvm_role_flag:
1790
+ if "type" in cred and cred["type"] == "cvm-role":
1791
+ g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
1780
1792
 
1781
1793
  for param in g_param.keys():
1782
1794
  if g_param[param] is None: