Skip to content
Snippets Groups Projects
Commit ebdb49bb authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

director-cli: check http status instead of existcode on object creation

parent 0cc08944
No related branches found
No related tags found
1 merge request!39director-cli: check http status instead of existcode on object creation
This commit is part of merge request !39. Comments created here will be created in the context of that merge request.
...@@ -503,7 +503,9 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server" ...@@ -503,7 +503,9 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server"
_action=update _action=update
fi fi
if ObjAction $_action service; then # if ObjAction $_action service; then
ObjAction $_action service
if [ -z "$(http.isOk)" ]; then
echo "OK $_action service ${IDC_service__obj_name}" echo "OK $_action service ${IDC_service__obj_name}"
return 0 return 0
else else
...@@ -525,7 +527,9 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server" ...@@ -525,7 +527,9 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server"
# create command if it does not exist # create command if it does not exist
if serviceCreateOrUpdate >/dev/null ; then if serviceCreateOrUpdate >/dev/null ; then
if ! ObjAction exists svclink; then if ! ObjAction exists svclink; then
if ObjAction create svclink; then # if ObjAction create svclink; then
ObjAction create svclink
if [ -z "$(http.isOk)" ]; then
echo "OK: linked service ${checkName} on host [$MY_NAME] was created" echo "OK: linked service ${checkName} on host [$MY_NAME] was created"
else else
echo "ERROR :-/ unable to create linked service ${checkName} on host [$MY_NAME]" echo "ERROR :-/ unable to create linked service ${checkName} on host [$MY_NAME]"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment