Skip to content

Commit

Permalink
Merge pull request #5263 from i18nsite/patch-1
Browse files Browse the repository at this point in the history
Update dns_huaweicloud.sh
  • Loading branch information
Neilpang authored Sep 13, 2024
2 parents c71dcd7 + cefa7d9 commit deb2a3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/DNS.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: DNS
on:
workflow_dispatch:
push:
paths:
- 'dnsapi/*.sh'
Expand Down
4 changes: 2 additions & 2 deletions dnsapi/dns_huaweicloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ _get_recordset_id() {
_zoneid=$3
export _H1="X-Auth-Token: ${_token}"

response=$(_get "${dns_api}/v2/zones/${_zoneid}/recordsets?name=${_domain}")
response=$(_get "${dns_api}/v2/zones/${_zoneid}/recordsets?name=${_domain}&status=ACTIVE")
if _contains "${response}" '"id"'; then
_id="$(echo "${response}" | _egrep_o "\"id\": *\"[^\"]*\"" | cut -d : -f 2 | tr -d \" | tr -d " ")"
printf "%s" "${_id}"
Expand All @@ -227,7 +227,7 @@ _add_record() {

# Get Existing Records
export _H1="X-Auth-Token: ${_token}"
response=$(_get "${dns_api}/v2/zones/${zoneid}/recordsets?name=${_domain}")
response=$(_get "${dns_api}/v2/zones/${zoneid}/recordsets?name=${_domain}&status=ACTIVE")

_debug2 "${response}"
_exist_record=$(echo "${response}" | _egrep_o '"records":[^]]*' | sed 's/\"records\"\:\[//g')
Expand Down

0 comments on commit deb2a3e

Please sign in to comment.