Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
8718b156
Unverified
Commit
8718b156
authored
Jan 22, 2023
by
neil
Committed by
GitHub
Jan 22, 2023
Browse files
Merge pull request #4471 from vladislav-sharapov/patch-1
fix(dns_openstack): fix argparse error
parents
ffed1a4a
7bbdd1f8
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_openstack.sh
View file @
8718b156
...
@@ -57,16 +57,16 @@ _dns_openstack_create_recordset() {
...
@@ -57,16 +57,16 @@ _dns_openstack_create_recordset() {
if
[
-z
"
$_recordset_id
"
]
;
then
if
[
-z
"
$_recordset_id
"
]
;
then
_info
"Creating a new recordset"
_info
"Creating a new recordset"
if
!
_recordset_id
=
$(
openstack recordset create
-c
id
-f
value
--type
TXT
--record
"
$txtvalue
"
"
$_zone_id
"
"
$fulldomain
."
)
;
then
if
!
_recordset_id
=
$(
openstack recordset create
-c
id
-f
value
--type
TXT
--record
=
"
$txtvalue
"
"
$_zone_id
"
"
$fulldomain
."
)
;
then
_err
"No recordset ID found after create"
_err
"No recordset ID found after create"
return
1
return
1
fi
fi
else
else
_info
"Updating existing recordset"
_info
"Updating existing recordset"
# Build new list of --record
<rec> args for update
# Build new list of --record
=
<rec> args for update
_record_args
=
"--record
$txtvalue
"
_record_args
=
"--record
=
$txtvalue
"
for
_rec
in
$_records
;
do
for
_rec
in
$_records
;
do
_record_args
=
"
$_record_args
--record
$_rec
"
_record_args
=
"
$_record_args
--record
=
$_rec
"
done
done
# shellcheck disable=SC2086
# shellcheck disable=SC2086
if
!
_recordset_id
=
$(
openstack recordset
set
-c
id
-f
value
$_record_args
"
$_zone_id
"
"
$fulldomain
."
)
;
then
if
!
_recordset_id
=
$(
openstack recordset
set
-c
id
-f
value
$_record_args
"
$_zone_id
"
"
$fulldomain
."
)
;
then
...
@@ -107,13 +107,13 @@ _dns_openstack_delete_recordset() {
...
@@ -107,13 +107,13 @@ _dns_openstack_delete_recordset() {
fi
fi
else
else
_info
"Found existing records, updating recordset"
_info
"Found existing records, updating recordset"
# Build new list of --record
<rec> args for update
# Build new list of --record
=
<rec> args for update
_record_args
=
""
_record_args
=
""
for
_rec
in
$_records
;
do
for
_rec
in
$_records
;
do
if
[
"
$_rec
"
=
"
$txtvalue
"
]
;
then
if
[
"
$_rec
"
=
"
$txtvalue
"
]
;
then
continue
continue
fi
fi
_record_args
=
"
$_record_args
--record
$_rec
"
_record_args
=
"
$_record_args
--record
=
$_rec
"
done
done
# shellcheck disable=SC2086
# shellcheck disable=SC2086
if
!
openstack recordset
set
-c
id
-f
value
$_record_args
"
$_zone_id
"
"
$fulldomain
."
>
/dev/null
;
then
if
!
openstack recordset
set
-c
id
-f
value
$_record_args
"
$_zone_id
"
"
$fulldomain
."
>
/dev/null
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment