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.
- tccli/__init__.py +1 -1
- tccli/command.py +0 -1
- tccli/configure.py +11 -1
- tccli/services/aa/aa_client.py +13 -1
- tccli/services/aai/aai_client.py +13 -1
- tccli/services/acp/acp_client.py +13 -1
- tccli/services/advisor/advisor_client.py +13 -1
- tccli/services/af/af_client.py +13 -1
- tccli/services/afc/afc_client.py +13 -1
- tccli/services/aiart/aiart_client.py +13 -1
- tccli/services/ame/ame_client.py +13 -1
- tccli/services/ams/ams_client.py +13 -1
- tccli/services/anicloud/anicloud_client.py +13 -1
- tccli/services/antiddos/antiddos_client.py +13 -1
- tccli/services/apcas/apcas_client.py +13 -1
- tccli/services/ape/ape_client.py +13 -1
- tccli/services/api/api_client.py +13 -1
- tccli/services/apigateway/apigateway_client.py +13 -1
- tccli/services/apm/apm_client.py +13 -1
- tccli/services/asr/asr_client.py +13 -1
- tccli/services/asw/asw_client.py +13 -1
- tccli/services/autoscaling/autoscaling_client.py +13 -1
- tccli/services/ba/ba_client.py +13 -1
- tccli/services/batch/batch_client.py +13 -1
- tccli/services/bda/bda_client.py +13 -1
- tccli/services/bh/bh_client.py +13 -1
- tccli/services/bi/bi_client.py +13 -1
- tccli/services/billing/billing_client.py +13 -1
- tccli/services/bizlive/bizlive_client.py +13 -1
- tccli/services/bm/bm_client.py +13 -1
- tccli/services/bma/bma_client.py +13 -1
- tccli/services/bmeip/bmeip_client.py +13 -1
- tccli/services/bmlb/bmlb_client.py +13 -1
- tccli/services/bmvpc/bmvpc_client.py +13 -1
- tccli/services/bpaas/bpaas_client.py +13 -1
- tccli/services/bri/bri_client.py +13 -1
- tccli/services/bsca/bsca_client.py +13 -1
- tccli/services/btoe/btoe_client.py +13 -1
- tccli/services/ca/ca_client.py +13 -1
- tccli/services/cam/cam_client.py +13 -1
- tccli/services/captcha/captcha_client.py +13 -1
- tccli/services/car/car_client.py +13 -1
- tccli/services/cat/cat_client.py +13 -1
- tccli/services/cbs/cbs_client.py +13 -1
- tccli/services/ccc/ccc_client.py +13 -1
- tccli/services/cdb/cdb_client.py +13 -1
- tccli/services/cdc/cdc_client.py +13 -1
- tccli/services/cdn/cdn_client.py +13 -1
- tccli/services/cds/cds_client.py +13 -1
- tccli/services/cdwch/cdwch_client.py +13 -1
- tccli/services/cdwdoris/cdwdoris_client.py +13 -1
- tccli/services/cdwpg/cdwpg_client.py +13 -1
- tccli/services/cdz/cdz_client.py +13 -1
- tccli/services/cfg/cfg_client.py +13 -1
- tccli/services/cfs/cfs_client.py +13 -1
- tccli/services/cfw/cfw_client.py +13 -1
- tccli/services/chdfs/chdfs_client.py +13 -1
- tccli/services/ciam/ciam_client.py +13 -1
- tccli/services/cii/cii_client.py +13 -1
- tccli/services/cim/cim_client.py +13 -1
- tccli/services/cis/cis_client.py +13 -1
- tccli/services/ckafka/ckafka_client.py +13 -1
- tccli/services/clb/clb_client.py +13 -1
- tccli/services/cloudapp/cloudapp_client.py +13 -1
- tccli/services/cloudaudit/cloudaudit_client.py +13 -1
- tccli/services/cloudhsm/cloudhsm_client.py +13 -1
- tccli/services/cloudstudio/cloudstudio_client.py +13 -1
- tccli/services/cls/cls_client.py +13 -1
- tccli/services/cme/cme_client.py +13 -1
- tccli/services/cmq/cmq_client.py +13 -1
- tccli/services/cms/cms_client.py +13 -1
- tccli/services/config/config_client.py +13 -1
- tccli/services/controlcenter/controlcenter_client.py +13 -1
- tccli/services/cpdp/cpdp_client.py +13 -1
- tccli/services/csip/csip_client.py +13 -1
- tccli/services/csxg/csxg_client.py +13 -1
- tccli/services/cvm/cvm_client.py +13 -1
- tccli/services/cwp/cwp_client.py +13 -1
- tccli/services/cws/cws_client.py +13 -1
- tccli/services/cynosdb/cynosdb_client.py +13 -1
- tccli/services/dasb/dasb_client.py +13 -1
- tccli/services/dataintegration/dataintegration_client.py +13 -1
- tccli/services/dayu/dayu_client.py +13 -1
- tccli/services/dbbrain/dbbrain_client.py +13 -1
- tccli/services/dbdc/dbdc_client.py +13 -1
- tccli/services/dc/dc_client.py +13 -1
- tccli/services/dcdb/dcdb_client.py +13 -1
- tccli/services/dlc/dlc_client.py +13 -1
- tccli/services/dnspod/dnspod_client.py +13 -1
- tccli/services/domain/domain_client.py +13 -1
- tccli/services/drm/drm_client.py +13 -1
- tccli/services/ds/ds_client.py +13 -1
- tccli/services/dsgc/dsgc_client.py +13 -1
- tccli/services/dtf/dtf_client.py +13 -1
- tccli/services/dts/dts_client.py +13 -1
- tccli/services/eb/eb_client.py +13 -1
- tccli/services/ecc/ecc_client.py +13 -1
- tccli/services/ecdn/ecdn_client.py +13 -1
- tccli/services/ecm/ecm_client.py +13 -1
- tccli/services/eiam/eiam_client.py +13 -1
- tccli/services/eis/eis_client.py +13 -1
- tccli/services/emr/emr_client.py +13 -1
- tccli/services/es/es_client.py +13 -1
- tccli/services/ess/ess_client.py +13 -1
- tccli/services/essbasic/essbasic_client.py +13 -1
- tccli/services/facefusion/facefusion_client.py +13 -1
- tccli/services/faceid/faceid_client.py +13 -1
- tccli/services/fmu/fmu_client.py +13 -1
- tccli/services/ft/ft_client.py +13 -1
- tccli/services/gaap/gaap_client.py +13 -1
- tccli/services/gme/gme_client.py +13 -1
- tccli/services/goosefs/goosefs_client.py +13 -1
- tccli/services/gpm/gpm_client.py +13 -1
- tccli/services/gs/gs_client.py +13 -1
- tccli/services/gse/gse_client.py +13 -1
- tccli/services/gwlb/gwlb_client.py +13 -1
- tccli/services/habo/habo_client.py +13 -1
- tccli/services/hai/hai_client.py +13 -1
- tccli/services/hasim/hasim_client.py +13 -1
- tccli/services/hcm/hcm_client.py +13 -1
- tccli/services/hunyuan/hunyuan_client.py +13 -1
- tccli/services/iai/iai_client.py +13 -1
- tccli/services/ic/ic_client.py +13 -1
- tccli/services/icr/icr_client.py +13 -1
- tccli/services/ie/ie_client.py +13 -1
- tccli/services/iecp/iecp_client.py +13 -1
- tccli/services/ig/ig_client.py +13 -1
- tccli/services/iir/iir_client.py +13 -1
- tccli/services/ims/ims_client.py +13 -1
- tccli/services/ioa/ioa_client.py +13 -1
- tccli/services/iot/iot_client.py +13 -1
- tccli/services/iotcloud/iotcloud_client.py +13 -1
- tccli/services/iotexplorer/iotexplorer_client.py +13 -1
- tccli/services/iottid/iottid_client.py +13 -1
- tccli/services/iotvideo/iotvideo_client.py +13 -1
- tccli/services/iotvideoindustry/iotvideoindustry_client.py +13 -1
- tccli/services/irp/irp_client.py +13 -1
- tccli/services/iss/iss_client.py +13 -1
- tccli/services/ivld/ivld_client.py +13 -1
- tccli/services/keewidb/keewidb_client.py +13 -1
- tccli/services/kms/kms_client.py +13 -1
- tccli/services/lcic/lcic_client.py +13 -1
- tccli/services/lighthouse/lighthouse_client.py +13 -1
- tccli/services/live/live_client.py +13 -1
- tccli/services/lke/lke_client.py +13 -1
- tccli/services/lowcode/lowcode_client.py +13 -1
- tccli/services/lp/lp_client.py +13 -1
- tccli/services/mall/mall_client.py +13 -1
- tccli/services/mariadb/mariadb_client.py +13 -1
- tccli/services/market/market_client.py +13 -1
- tccli/services/memcached/memcached_client.py +13 -1
- tccli/services/mgobe/mgobe_client.py +13 -1
- tccli/services/mmps/mmps_client.py +13 -1
- tccli/services/mna/mna_client.py +13 -1
- tccli/services/mongodb/mongodb_client.py +13 -1
- tccli/services/monitor/monitor_client.py +13 -1
- tccli/services/mps/mps_client.py +13 -1
- tccli/services/mqtt/mqtt_client.py +13 -1
- tccli/services/mrs/mrs_client.py +13 -1
- tccli/services/ms/ms_client.py +13 -1
- tccli/services/msp/msp_client.py +13 -1
- tccli/services/mvj/mvj_client.py +13 -1
- tccli/services/nlp/nlp_client.py +13 -1
- tccli/services/npp/npp_client.py +13 -1
- tccli/services/oceanus/oceanus_client.py +13 -1
- tccli/services/ocr/ocr_client.py +13 -1
- tccli/services/omics/omics_client.py +13 -1
- tccli/services/organization/organization_client.py +13 -1
- tccli/services/partners/partners_client.py +13 -1
- tccli/services/pds/pds_client.py +13 -1
- tccli/services/postgres/postgres_client.py +13 -1
- tccli/services/privatedns/privatedns_client.py +13 -1
- tccli/services/pts/pts_client.py +13 -1
- tccli/services/rce/rce_client.py +13 -1
- tccli/services/redis/redis_client.py +13 -1
- tccli/services/region/region_client.py +13 -1
- tccli/services/rkp/rkp_client.py +13 -1
- tccli/services/rp/rp_client.py +13 -1
- tccli/services/rum/rum_client.py +13 -1
- tccli/services/scf/scf_client.py +13 -1
- tccli/services/ses/ses_client.py +13 -1
- tccli/services/smh/smh_client.py +13 -1
- tccli/services/smop/smop_client.py +13 -1
- tccli/services/smpn/smpn_client.py +13 -1
- tccli/services/sms/sms_client.py +13 -1
- tccli/services/soe/soe_client.py +13 -1
- tccli/services/solar/solar_client.py +13 -1
- tccli/services/sqlserver/sqlserver_client.py +13 -1
- tccli/services/ssa/ssa_client.py +13 -1
- tccli/services/ssl/ssl_client.py +13 -1
- tccli/services/sslpod/sslpod_client.py +13 -1
- tccli/services/ssm/ssm_client.py +13 -1
- tccli/services/sts/sts_client.py +13 -1
- tccli/services/svp/svp_client.py +13 -1
- tccli/services/taf/taf_client.py +13 -1
- tccli/services/tag/tag_client.py +13 -1
- tccli/services/tan/tan_client.py +13 -1
- tccli/services/tat/tat_client.py +13 -1
- tccli/services/tav/tav_client.py +13 -1
- tccli/services/tbaas/tbaas_client.py +13 -1
- tccli/services/tbm/tbm_client.py +13 -1
- tccli/services/tbp/tbp_client.py +13 -1
- tccli/services/tcaplusdb/tcaplusdb_client.py +13 -1
- tccli/services/tcb/tcb_client.py +13 -1
- tccli/services/tcbr/tcbr_client.py +13 -1
- tccli/services/tcex/tcex_client.py +13 -1
- tccli/services/tchd/tchd_client.py +13 -1
- tccli/services/tci/tci_client.py +13 -1
- tccli/services/tcm/tcm_client.py +13 -1
- tccli/services/tcr/tcr_client.py +13 -1
- tccli/services/tcss/tcss_client.py +13 -1
- tccli/services/tdcpg/tdcpg_client.py +13 -1
- tccli/services/tdid/tdid_client.py +13 -1
- tccli/services/tdmq/tdmq_client.py +13 -1
- tccli/services/tds/tds_client.py +13 -1
- tccli/services/tem/tem_client.py +13 -1
- tccli/services/teo/teo_client.py +13 -1
- tccli/services/thpc/thpc_client.py +13 -1
- tccli/services/tia/tia_client.py +13 -1
- tccli/services/tic/tic_client.py +13 -1
- tccli/services/ticm/ticm_client.py +13 -1
- tccli/services/tics/tics_client.py +13 -1
- tccli/services/tiems/tiems_client.py +13 -1
- tccli/services/tiia/tiia_client.py +13 -1
- tccli/services/tione/tione_client.py +13 -1
- tccli/services/tiw/tiw_client.py +13 -1
- tccli/services/tke/tke_client.py +13 -1
- tccli/services/tkgdq/tkgdq_client.py +13 -1
- tccli/services/tms/tms_client.py +13 -1
- tccli/services/tmt/tmt_client.py +13 -1
- tccli/services/tourism/tourism_client.py +13 -1
- tccli/services/trdp/trdp_client.py +13 -1
- tccli/services/trocket/trocket_client.py +13 -1
- tccli/services/trp/trp_client.py +13 -1
- tccli/services/trro/trro_client.py +13 -1
- tccli/services/trtc/trtc_client.py +13 -1
- tccli/services/tse/tse_client.py +13 -1
- tccli/services/tsf/tsf_client.py +13 -1
- tccli/services/tsi/tsi_client.py +13 -1
- tccli/services/tsw/tsw_client.py +13 -1
- tccli/services/tts/tts_client.py +13 -1
- tccli/services/ump/ump_client.py +13 -1
- tccli/services/vcg/vcg_client.py +13 -1
- tccli/services/vclm/vclm_client.py +13 -1
- tccli/services/vdb/vdb_client.py +13 -1
- tccli/services/vm/vm_client.py +13 -1
- tccli/services/vms/vms_client.py +13 -1
- tccli/services/vod/vod_client.py +13 -1
- tccli/services/vpc/vpc_client.py +13 -1
- tccli/services/vrs/vrs_client.py +13 -1
- tccli/services/vtc/vtc_client.py +13 -1
- tccli/services/waf/waf_client.py +13 -1
- tccli/services/wav/wav_client.py +13 -1
- tccli/services/wedata/wedata_client.py +13 -1
- tccli/services/weilingwith/weilingwith_client.py +13 -1
- tccli/services/wss/wss_client.py +13 -1
- tccli/services/yinsuda/yinsuda_client.py +13 -1
- tccli/services/youmall/youmall_client.py +13 -1
- tccli/services/yunjing/yunjing_client.py +13 -1
- tccli/services/yunsou/yunsou_client.py +13 -1
- tccli/utils.py +8 -0
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/RECORD +266 -266
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1218.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/ca/ca_client.py
CHANGED
@@ -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:
|
tccli/services/cam/cam_client.py
CHANGED
@@ -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:
|
@@ -997,7 +997,13 @@ def action_caller():
|
|
997
997
|
|
998
998
|
def parse_global_arg(parsed_globals):
|
999
999
|
g_param = parsed_globals
|
1000
|
-
|
1000
|
+
cvm_role_flag = True
|
1001
|
+
for param in parsed_globals.keys():
|
1002
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
1003
|
+
OptionsDefine.RoleSessionName]:
|
1004
|
+
if parsed_globals[param] is not None:
|
1005
|
+
cvm_role_flag = False
|
1006
|
+
break
|
1001
1007
|
is_exist_profile = True
|
1002
1008
|
if not parsed_globals["profile"]:
|
1003
1009
|
is_exist_profile = False
|
@@ -1028,6 +1034,7 @@ def parse_global_arg(parsed_globals):
|
|
1028
1034
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
1029
1035
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
1030
1036
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
1037
|
+
cvm_role_flag = False
|
1031
1038
|
|
1032
1039
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
1033
1040
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -1035,6 +1042,11 @@ def parse_global_arg(parsed_globals):
|
|
1035
1042
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
1036
1043
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
1037
1044
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
1045
|
+
cvm_role_flag = False
|
1046
|
+
|
1047
|
+
if cvm_role_flag:
|
1048
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
1049
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
1038
1050
|
|
1039
1051
|
for param in g_param.keys():
|
1040
1052
|
if g_param[param] is None:
|
tccli/services/car/car_client.py
CHANGED
@@ -361,7 +361,13 @@ def action_caller():
|
|
361
361
|
|
362
362
|
def parse_global_arg(parsed_globals):
|
363
363
|
g_param = parsed_globals
|
364
|
-
|
364
|
+
cvm_role_flag = True
|
365
|
+
for param in parsed_globals.keys():
|
366
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
367
|
+
OptionsDefine.RoleSessionName]:
|
368
|
+
if parsed_globals[param] is not None:
|
369
|
+
cvm_role_flag = False
|
370
|
+
break
|
365
371
|
is_exist_profile = True
|
366
372
|
if not parsed_globals["profile"]:
|
367
373
|
is_exist_profile = False
|
@@ -392,6 +398,7 @@ def parse_global_arg(parsed_globals):
|
|
392
398
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
393
399
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
394
400
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
401
|
+
cvm_role_flag = False
|
395
402
|
|
396
403
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
397
404
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -399,6 +406,11 @@ def parse_global_arg(parsed_globals):
|
|
399
406
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
400
407
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
401
408
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
409
|
+
cvm_role_flag = False
|
410
|
+
|
411
|
+
if cvm_role_flag:
|
412
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
413
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
402
414
|
|
403
415
|
for param in g_param.keys():
|
404
416
|
if g_param[param] is None:
|
tccli/services/cat/cat_client.py
CHANGED
@@ -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:
|
tccli/services/cbs/cbs_client.py
CHANGED
@@ -2269,7 +2269,13 @@ def action_caller():
|
|
2269
2269
|
|
2270
2270
|
def parse_global_arg(parsed_globals):
|
2271
2271
|
g_param = parsed_globals
|
2272
|
-
|
2272
|
+
cvm_role_flag = True
|
2273
|
+
for param in parsed_globals.keys():
|
2274
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
2275
|
+
OptionsDefine.RoleSessionName]:
|
2276
|
+
if parsed_globals[param] is not None:
|
2277
|
+
cvm_role_flag = False
|
2278
|
+
break
|
2273
2279
|
is_exist_profile = True
|
2274
2280
|
if not parsed_globals["profile"]:
|
2275
2281
|
is_exist_profile = False
|
@@ -2300,6 +2306,7 @@ def parse_global_arg(parsed_globals):
|
|
2300
2306
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
2301
2307
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
2302
2308
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
2309
|
+
cvm_role_flag = False
|
2303
2310
|
|
2304
2311
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
2305
2312
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -2307,6 +2314,11 @@ def parse_global_arg(parsed_globals):
|
|
2307
2314
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
2308
2315
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
2309
2316
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
2317
|
+
cvm_role_flag = False
|
2318
|
+
|
2319
|
+
if cvm_role_flag:
|
2320
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
2321
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
2310
2322
|
|
2311
2323
|
for param in g_param.keys():
|
2312
2324
|
if g_param[param] is None:
|
tccli/services/ccc/ccc_client.py
CHANGED
@@ -3329,7 +3329,13 @@ def action_caller():
|
|
3329
3329
|
|
3330
3330
|
def parse_global_arg(parsed_globals):
|
3331
3331
|
g_param = parsed_globals
|
3332
|
-
|
3332
|
+
cvm_role_flag = True
|
3333
|
+
for param in parsed_globals.keys():
|
3334
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
3335
|
+
OptionsDefine.RoleSessionName]:
|
3336
|
+
if parsed_globals[param] is not None:
|
3337
|
+
cvm_role_flag = False
|
3338
|
+
break
|
3333
3339
|
is_exist_profile = True
|
3334
3340
|
if not parsed_globals["profile"]:
|
3335
3341
|
is_exist_profile = False
|
@@ -3360,6 +3366,7 @@ def parse_global_arg(parsed_globals):
|
|
3360
3366
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
3361
3367
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
3362
3368
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
3369
|
+
cvm_role_flag = False
|
3363
3370
|
|
3364
3371
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
3365
3372
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -3367,6 +3374,11 @@ def parse_global_arg(parsed_globals):
|
|
3367
3374
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
3368
3375
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
3369
3376
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
3377
|
+
cvm_role_flag = False
|
3378
|
+
|
3379
|
+
if cvm_role_flag:
|
3380
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
3381
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
3370
3382
|
|
3371
3383
|
for param in g_param.keys():
|
3372
3384
|
if g_param[param] is None:
|
tccli/services/cdb/cdb_client.py
CHANGED
@@ -9053,7 +9053,13 @@ def action_caller():
|
|
9053
9053
|
|
9054
9054
|
def parse_global_arg(parsed_globals):
|
9055
9055
|
g_param = parsed_globals
|
9056
|
-
|
9056
|
+
cvm_role_flag = True
|
9057
|
+
for param in parsed_globals.keys():
|
9058
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
9059
|
+
OptionsDefine.RoleSessionName]:
|
9060
|
+
if parsed_globals[param] is not None:
|
9061
|
+
cvm_role_flag = False
|
9062
|
+
break
|
9057
9063
|
is_exist_profile = True
|
9058
9064
|
if not parsed_globals["profile"]:
|
9059
9065
|
is_exist_profile = False
|
@@ -9084,6 +9090,7 @@ def parse_global_arg(parsed_globals):
|
|
9084
9090
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
9085
9091
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
9086
9092
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
9093
|
+
cvm_role_flag = False
|
9087
9094
|
|
9088
9095
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
9089
9096
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -9091,6 +9098,11 @@ def parse_global_arg(parsed_globals):
|
|
9091
9098
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
9092
9099
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
9093
9100
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
9101
|
+
cvm_role_flag = False
|
9102
|
+
|
9103
|
+
if cvm_role_flag:
|
9104
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
9105
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
9094
9106
|
|
9095
9107
|
for param in g_param.keys():
|
9096
9108
|
if g_param[param] is None:
|
tccli/services/cdc/cdc_client.py
CHANGED
@@ -1156,7 +1156,13 @@ def action_caller():
|
|
1156
1156
|
|
1157
1157
|
def parse_global_arg(parsed_globals):
|
1158
1158
|
g_param = parsed_globals
|
1159
|
-
|
1159
|
+
cvm_role_flag = True
|
1160
|
+
for param in parsed_globals.keys():
|
1161
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
1162
|
+
OptionsDefine.RoleSessionName]:
|
1163
|
+
if parsed_globals[param] is not None:
|
1164
|
+
cvm_role_flag = False
|
1165
|
+
break
|
1160
1166
|
is_exist_profile = True
|
1161
1167
|
if not parsed_globals["profile"]:
|
1162
1168
|
is_exist_profile = False
|
@@ -1187,6 +1193,7 @@ def parse_global_arg(parsed_globals):
|
|
1187
1193
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
1188
1194
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
1189
1195
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
1196
|
+
cvm_role_flag = False
|
1190
1197
|
|
1191
1198
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
1192
1199
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -1194,6 +1201,11 @@ def parse_global_arg(parsed_globals):
|
|
1194
1201
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
1195
1202
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
1196
1203
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
1204
|
+
cvm_role_flag = False
|
1205
|
+
|
1206
|
+
if cvm_role_flag:
|
1207
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
1208
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
1197
1209
|
|
1198
1210
|
for param in g_param.keys():
|
1199
1211
|
if g_param[param] is None:
|
tccli/services/cdn/cdn_client.py
CHANGED
@@ -4336,7 +4336,13 @@ def action_caller():
|
|
4336
4336
|
|
4337
4337
|
def parse_global_arg(parsed_globals):
|
4338
4338
|
g_param = parsed_globals
|
4339
|
-
|
4339
|
+
cvm_role_flag = True
|
4340
|
+
for param in parsed_globals.keys():
|
4341
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
4342
|
+
OptionsDefine.RoleSessionName]:
|
4343
|
+
if parsed_globals[param] is not None:
|
4344
|
+
cvm_role_flag = False
|
4345
|
+
break
|
4340
4346
|
is_exist_profile = True
|
4341
4347
|
if not parsed_globals["profile"]:
|
4342
4348
|
is_exist_profile = False
|
@@ -4367,6 +4373,7 @@ def parse_global_arg(parsed_globals):
|
|
4367
4373
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
4368
4374
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
4369
4375
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
4376
|
+
cvm_role_flag = False
|
4370
4377
|
|
4371
4378
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
4372
4379
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -4374,6 +4381,11 @@ def parse_global_arg(parsed_globals):
|
|
4374
4381
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
4375
4382
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
4376
4383
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
4384
|
+
cvm_role_flag = False
|
4385
|
+
|
4386
|
+
if cvm_role_flag:
|
4387
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
4388
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
4377
4389
|
|
4378
4390
|
for param in g_param.keys():
|
4379
4391
|
if g_param[param] is None:
|
tccli/services/cds/cds_client.py
CHANGED
@@ -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:
|
@@ -1474,7 +1474,13 @@ def action_caller():
|
|
1474
1474
|
|
1475
1475
|
def parse_global_arg(parsed_globals):
|
1476
1476
|
g_param = parsed_globals
|
1477
|
-
|
1477
|
+
cvm_role_flag = True
|
1478
|
+
for param in parsed_globals.keys():
|
1479
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
1480
|
+
OptionsDefine.RoleSessionName]:
|
1481
|
+
if parsed_globals[param] is not None:
|
1482
|
+
cvm_role_flag = False
|
1483
|
+
break
|
1478
1484
|
is_exist_profile = True
|
1479
1485
|
if not parsed_globals["profile"]:
|
1480
1486
|
is_exist_profile = False
|
@@ -1505,6 +1511,7 @@ def parse_global_arg(parsed_globals):
|
|
1505
1511
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
1506
1512
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
1507
1513
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
1514
|
+
cvm_role_flag = False
|
1508
1515
|
|
1509
1516
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
1510
1517
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -1512,6 +1519,11 @@ def parse_global_arg(parsed_globals):
|
|
1512
1519
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
1513
1520
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
1514
1521
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
1522
|
+
cvm_role_flag = False
|
1523
|
+
|
1524
|
+
if cvm_role_flag:
|
1525
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
1526
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
1515
1527
|
|
1516
1528
|
for param in g_param.keys():
|
1517
1529
|
if g_param[param] is None:
|
@@ -3223,7 +3223,13 @@ def action_caller():
|
|
3223
3223
|
|
3224
3224
|
def parse_global_arg(parsed_globals):
|
3225
3225
|
g_param = parsed_globals
|
3226
|
-
|
3226
|
+
cvm_role_flag = True
|
3227
|
+
for param in parsed_globals.keys():
|
3228
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
3229
|
+
OptionsDefine.RoleSessionName]:
|
3230
|
+
if parsed_globals[param] is not None:
|
3231
|
+
cvm_role_flag = False
|
3232
|
+
break
|
3227
3233
|
is_exist_profile = True
|
3228
3234
|
if not parsed_globals["profile"]:
|
3229
3235
|
is_exist_profile = False
|
@@ -3254,6 +3260,7 @@ def parse_global_arg(parsed_globals):
|
|
3254
3260
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
3255
3261
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
3256
3262
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
3263
|
+
cvm_role_flag = False
|
3257
3264
|
|
3258
3265
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
3259
3266
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -3261,6 +3268,11 @@ def parse_global_arg(parsed_globals):
|
|
3261
3268
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
3262
3269
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
3263
3270
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
3271
|
+
cvm_role_flag = False
|
3272
|
+
|
3273
|
+
if cvm_role_flag:
|
3274
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
3275
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
3264
3276
|
|
3265
3277
|
for param in g_param.keys():
|
3266
3278
|
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:
|
tccli/services/cdz/cdz_client.py
CHANGED
@@ -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:
|
tccli/services/cfg/cfg_client.py
CHANGED
@@ -891,7 +891,13 @@ def action_caller():
|
|
891
891
|
|
892
892
|
def parse_global_arg(parsed_globals):
|
893
893
|
g_param = parsed_globals
|
894
|
-
|
894
|
+
cvm_role_flag = True
|
895
|
+
for param in parsed_globals.keys():
|
896
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
897
|
+
OptionsDefine.RoleSessionName]:
|
898
|
+
if parsed_globals[param] is not None:
|
899
|
+
cvm_role_flag = False
|
900
|
+
break
|
895
901
|
is_exist_profile = True
|
896
902
|
if not parsed_globals["profile"]:
|
897
903
|
is_exist_profile = False
|
@@ -922,6 +928,7 @@ def parse_global_arg(parsed_globals):
|
|
922
928
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
923
929
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
924
930
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
931
|
+
cvm_role_flag = False
|
925
932
|
|
926
933
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
927
934
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -929,6 +936,11 @@ def parse_global_arg(parsed_globals):
|
|
929
936
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
930
937
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
931
938
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
939
|
+
cvm_role_flag = False
|
940
|
+
|
941
|
+
if cvm_role_flag:
|
942
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
943
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
932
944
|
|
933
945
|
for param in g_param.keys():
|
934
946
|
if g_param[param] is None:
|
tccli/services/cfs/cfs_client.py
CHANGED
@@ -2322,7 +2322,13 @@ def action_caller():
|
|
2322
2322
|
|
2323
2323
|
def parse_global_arg(parsed_globals):
|
2324
2324
|
g_param = parsed_globals
|
2325
|
-
|
2325
|
+
cvm_role_flag = True
|
2326
|
+
for param in parsed_globals.keys():
|
2327
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
2328
|
+
OptionsDefine.RoleSessionName]:
|
2329
|
+
if parsed_globals[param] is not None:
|
2330
|
+
cvm_role_flag = False
|
2331
|
+
break
|
2326
2332
|
is_exist_profile = True
|
2327
2333
|
if not parsed_globals["profile"]:
|
2328
2334
|
is_exist_profile = False
|
@@ -2353,6 +2359,7 @@ def parse_global_arg(parsed_globals):
|
|
2353
2359
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
2354
2360
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
2355
2361
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
2362
|
+
cvm_role_flag = False
|
2356
2363
|
|
2357
2364
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
2358
2365
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -2360,6 +2367,11 @@ def parse_global_arg(parsed_globals):
|
|
2360
2367
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
2361
2368
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
2362
2369
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
2370
|
+
cvm_role_flag = False
|
2371
|
+
|
2372
|
+
if cvm_role_flag:
|
2373
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
2374
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
2363
2375
|
|
2364
2376
|
for param in g_param.keys():
|
2365
2377
|
if g_param[param] is None:
|
tccli/services/cfw/cfw_client.py
CHANGED
@@ -6085,7 +6085,13 @@ def action_caller():
|
|
6085
6085
|
|
6086
6086
|
def parse_global_arg(parsed_globals):
|
6087
6087
|
g_param = parsed_globals
|
6088
|
-
|
6088
|
+
cvm_role_flag = True
|
6089
|
+
for param in parsed_globals.keys():
|
6090
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
6091
|
+
OptionsDefine.RoleSessionName]:
|
6092
|
+
if parsed_globals[param] is not None:
|
6093
|
+
cvm_role_flag = False
|
6094
|
+
break
|
6089
6095
|
is_exist_profile = True
|
6090
6096
|
if not parsed_globals["profile"]:
|
6091
6097
|
is_exist_profile = False
|
@@ -6116,6 +6122,7 @@ def parse_global_arg(parsed_globals):
|
|
6116
6122
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
6117
6123
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
6118
6124
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
6125
|
+
cvm_role_flag = False
|
6119
6126
|
|
6120
6127
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
6121
6128
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -6123,6 +6130,11 @@ def parse_global_arg(parsed_globals):
|
|
6123
6130
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
6124
6131
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
6125
6132
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
6133
|
+
cvm_role_flag = False
|
6134
|
+
|
6135
|
+
if cvm_role_flag:
|
6136
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
6137
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
6126
6138
|
|
6127
6139
|
for param in g_param.keys():
|
6128
6140
|
if g_param[param] is None:
|