Skip to content

Commit e3bc6b5

Browse files
ianwosfrickler
andcommitted
get_or_create_domain: simplify with "--or-show" argument
Similar to other functions, this uses "--or-show" to avoid double calls. Co-Authored-By: Jens Harbott <harbott@osism.tech> Change-Id: I548f9acd812687838e04b705f86f3b70d2b10caf
1 parent f0ad3e5 commit e3bc6b5

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

functions-common

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -875,14 +875,9 @@ function policy_add {
875875
# Usage: get_or_create_domain <name> <description>
876876
function get_or_create_domain {
877877
local domain_id
878-
# Gets domain id
879878
domain_id=$(
880-
# Gets domain id
881-
openstack --os-cloud devstack-system-admin domain show $1 \
882-
-f value -c id 2>/dev/null ||
883-
# Creates new domain
884879
openstack --os-cloud devstack-system-admin domain create $1 \
885-
--description "$2" \
880+
--description "$2" --or-show \
886881
-f value -c id
887882
)
888883
echo $domain_id

0 commit comments

Comments
 (0)