调整,以适应useregion灵活传值,注意,useregion非空为json串:{"method":"rst"},空为userRegion=
This commit is contained in:
@@ -112,8 +112,9 @@ AddPolicy2
|
||||
[Return] ${rescode} ${policyId}
|
||||
|
||||
EditPolicy
|
||||
[Arguments] @{body}
|
||||
[Return] ${rescode} ${objectId}
|
||||
[Arguments] ${body}
|
||||
${response} BaseEditRequest /v1/policy/compile ${body}
|
||||
[Return] ${rescode}
|
||||
|
||||
DeletePolicybak
|
||||
[Arguments] ${policyids}
|
||||
|
||||
@@ -65,11 +65,20 @@ PolicyParamsOpertion
|
||||
Set To Dictionary ${policyList} policyId= doBlacklist=${0}
|
||||
# 分别处理EffectiveRange、UserRegion和ReferenceObject参数
|
||||
ManageEffectiveRange ${policyList}
|
||||
ManageUserRegion ${policyList}
|
||||
#ManageUserRegion ${policyList}
|
||||
ManageReferenceObject ${policyList}
|
||||
#先取出useragion 再放回json
|
||||
${return} ${userRegion} Run Keyword And Ignore Error Set Variable ${policyList}[userRegion]
|
||||
Set To Dictionary ${policyList} userRegion=${Default_UserRegion}
|
||||
${userRegion} Run Keyword If "${return}"=="FAIL" or '${userRegion}'=="${EMPTY}" Set Variable ""
|
||||
... ELSE Set Variable ${userRegion}
|
||||
# 转为json结构并返回
|
||||
${dict} Create Dictionary opAction=add returnData=${returnData} policyList=${policyList}
|
||||
${json} json.Dumps ${dict} ensure_ascii=False
|
||||
${dict} Create Dictionary opAction=add returnData=${returnData} policyList=${policyList}
|
||||
${json} json.Dumps ${dict} ensure_ascii=False
|
||||
${json} Replace String ${json} "method:rst" ${userRegion}
|
||||
#${json} Evaluate ${userRegion}.replace('"method"','${userRegion}')
|
||||
#${json} Replace String ${json} "' {
|
||||
#${json} Replace String ${json} \" "
|
||||
Log Policy_Request_Body-${json}
|
||||
[Return] ${json}
|
||||
|
||||
@@ -157,6 +166,7 @@ ManageUserRegion
|
||||
${emptyObj} Create Dictionary
|
||||
|
||||
${return} ${userRegion} Run Keyword And Ignore Error Set Variable ${policyList}[userRegion]
|
||||
#${userRegion} Replace String ${userRegion} ' ${EMPTY}
|
||||
${userRegion} Run Keyword If "${return}"=="FAIL" or "${userRegion}"=="${EMPTY}" Set Variable ${Default_UserRegion}
|
||||
... ELSE Set Variable ${userRegion}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user