Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible-solidserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iam-public
ansible-solidserver
Commits
c1696d7c
Verified
Commit
c1696d7c
authored
1 year ago
by
Michael Filz
Browse files
Options
Downloads
Patches
Plain Diff
fix deleting just updated record
parent
e8f3dd7b
No related branches found
Branches containing commit
Tags
v1.0.2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
library/solidserver.py
+5
-2
5 additions, 2 deletions
library/solidserver.py
with
5 additions
and
2 deletions
library/solidserver.py
+
5
−
2
View file @
c1696d7c
...
...
@@ -305,7 +305,7 @@ class SOLID(object):
return
{
'
fqdn
'
:
fqdn
,
'
type
'
:
record_type
,
'
entries
'
:
data
}
def
add
(
self
,
fqdn
:
str
,
record_type
:
str
,
data
:
tuple
,
ttl
:
int
,
defer_update
:
bool
=
False
)
->
None
:
def
add
(
self
,
fqdn
:
str
,
record_type
:
str
,
data
:
tuple
,
ttl
:
int
,
defer_update
:
bool
=
False
)
->
str
:
"""
Add a DNS record
...
...
@@ -313,6 +313,8 @@ class SOLID(object):
record_type: DNS record type, e.g. A
data: record entry, e.g. the IPv4 address for an A record
ttl: record time to live
return value: oid of the new record
"""
logging
.
debug
(
f
'
Adding
{
record_type
}
record for
{
fqdn
}
'
)
servers
=
self
.
__servers_for_fqdn
(
fqdn
)
...
...
@@ -333,6 +335,7 @@ class SOLID(object):
raise
SOLIDError
(
f
'
Failed to add or update
{
record_type
}
record for
{
fqdn
}
on
{
s
}
:
{
r
[
"
err_msg
"
]
}
'
)
if
not
defer_update
:
self
.
records
=
self
.
__get_records
()
return
r
[
'
ret_oid
'
]
def
delete
(
self
,
fqdn
:
str
,
record_type
:
str
)
->
int
:
...
...
@@ -379,7 +382,7 @@ class SOLID(object):
logging
.
debug
(
f
'
WANT server=
{
s
}
, fqdn=
{
fqdn
}
, type=
{
record_type
}
, data=
{
"
,
"
.
join
(
self
.
__to_tuple
(
p
[
"
data
"
]))
}
, ttl=
{
p
[
"
ttl
"
]
}
'
)
match
=
[
r
for
r
in
self
.
records
if
r
[
'
dns_name
'
]
==
s
and
r
[
'
rr_type
'
]
==
record_type
and
r
[
'
rr_full_name_utf
'
]
==
fqdn
and
r
[
'
rr_all_value
'
]
==
'
,
'
.
join
(
self
.
__to_tuple
(
p
[
"
data
"
]))
and
r
[
'
ttl
'
]
==
str
(
p
[
'
ttl
'
])
]
if
not
match
:
self
.
add
(
fqdn
,
record_type
,
p
[
'
data
'
],
p
[
'
ttl
'
],
defer_update
=
True
)
found
.
append
(
self
.
add
(
fqdn
,
record_type
,
p
[
'
data
'
],
p
[
'
ttl
'
],
defer_update
=
True
)
)
changed
=
True
elif
len
(
match
)
==
1
:
logging
.
debug
(
f
'
FOUND server=
{
s
}
, fqdn=
{
fqdn
}
, type=
{
record_type
}
, data=
{
"
,
"
.
join
(
self
.
__to_tuple
(
p
[
"
data
"
]))
}
, ttl=
{
p
[
"
ttl
"
]
}
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment