summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2017-09-22 17:29:45 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2017-09-23 12:13:27 +0800
commit51a4cb9a4026037147da64b2353ec44002c7a7a7 (patch)
tree35ed98239693ac2a4af14be6b21d1daf7a10edd9
parenta224201e408aca8424b076b5e46138b5e322a9ef (diff)
Fix heat_stack_owner bug
In env installed by apex, there is no role of heat_stack_owner, so it need to separate the condition in script. JIRA:PARSER-157 Change-Id: Ie40715268a1124b57f0bf36ddc566bbcdbed964b Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
-rwxr-xr-xtests/functest_run.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/functest_run.sh b/tests/functest_run.sh
index b866ab9..a582d76 100755
--- a/tests/functest_run.sh
+++ b/tests/functest_run.sh
@@ -104,15 +104,18 @@ create_parser_user_and_project() {
}
# 3. grant role for parser user
- openstack ${debug} user role list ${PARSER_USER} --project ${PARSER_PROJECT} \
+ openstack ${debug} role list ${PARSER_USER} --project ${PARSER_PROJECT} \
| grep -qow ${PARSER_ROLE} && {
echo " User ${PARSER_USER} has role ${PARSER_ROLE} in project ${PARSER_PROJECT}, doesn't create."
} || {
openstack ${debug} role add ${PARSER_ROLE} --user ${PARSER_USER} \
--project ${PARSER_PROJECT}
- openstack ${debug} role add heat_stack_owner --user ${PARSER_USER} \
- --project ${PARSER_PROJECT}
- echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} and heat_stack_owner in project ${PARSER_PROJECT} successful."
+ echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} in project ${PARSER_PROJECT} successful."
+ openstack ${debug} role list | grep -qow heat_stack_owner && {
+ openstack ${debug} role add heat_stack_owner --user ${PARSER_USER} \
+ --project ${PARSER_PROJECT}
+ echo " Grant user ${PARSER_USER} the role heat_stack_owner in project ${PARSER_PROJECT} successful."
+ }
}
}