Skip to content

Commit c4d228a

Browse files
authored
Merge pull request #6493 from jdevera/proxmox_response_check
Show proxmox deploy scripts response only on debug
2 parents 30faf50 + 5aae333 commit c4d228a

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

deploy/proxmoxbs.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ HEREDOC
115115
_info "Push certificates to server"
116116
export HTTPS_INSECURE=1
117117
export _H1="Authorization: PBSAPIToken=${_proxmoxbs_header_api_token}"
118-
_post "$_json_payload" "$_target_url" "" POST "application/json"
118+
response=$(_post "$_json_payload" "$_target_url" "" POST "application/json")
119+
_retval=$?
120+
if [ "${_retval}" -eq 0 ]; then
121+
_debug3 response "$response"
122+
_info "Certificate successfully deployed"
123+
return 0
124+
else
125+
_err "Certificate deployment failed"
126+
_debug "Response" "$response"
127+
return 1
128+
fi
119129

120130
}

deploy/proxmoxve.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ HEREDOC
127127
_info "Push certificates to server"
128128
export HTTPS_INSECURE=1
129129
export _H1="Authorization: PVEAPIToken=${_proxmoxve_header_api_token}"
130-
_post "$_json_payload" "$_target_url" "" POST "application/json"
130+
response=$(_post "$_json_payload" "$_target_url" "" POST "application/json")
131+
_retval=$?
132+
if [ "${_retval}" -eq 0 ]; then
133+
_debug3 response "$response"
134+
_info "Certificate successfully deployed"
135+
return 0
136+
else
137+
_err "Certificate deployment failed"
138+
_debug "Response" "$response"
139+
return 1
140+
fi
131141

132142
}

0 commit comments

Comments
 (0)