浏览代码

dns_gcloud: allowrecord-sets list output to be separated by 'semicolon'

gcloud dns record-sets list used to separate records by comma, with
version 353.0.0 the tool uses semicolons instead.
Reto Schuettel 4 年之前
父节点
当前提交
401fd37e35
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      dnsapi/dns_gcloud.sh

+ 4 - 1
dnsapi/dns_gcloud.sh

@@ -163,5 +163,8 @@ _dns_gcloud_get_rrdatas() {
     return 1
   fi
   ttl=$(echo "$rrdatas" | cut -f1)
-  rrdatas=$(echo "$rrdatas" | cut -f2 | sed 's/","/"\n"/g')
+  # starting with version 353.0.0 gcloud seems to
+  # separate records with a semicolon instead of commas
+  # see also https://cloud.google.com/sdk/docs/release-notes#35300_2021-08-17
+  rrdatas=$(echo "$rrdatas" | cut -f2 | sed 's/"[,;]"/"\n"/g')
 }