Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hostinfo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
hostinfo
Commits
c3f7a419
Commit
c3f7a419
authored
8 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Add support for named/BIND SRV records
parent
ae271078
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hostinfo/named.py
+27
-0
27 additions, 0 deletions
src/hostinfo/named.py
with
27 additions
and
0 deletions
src/hostinfo/named.py
+
27
−
0
View file @
c3f7a419
...
@@ -194,6 +194,33 @@ def generate_forward(tree, hosts):
...
@@ -194,6 +194,33 @@ def generate_forward(tree, hosts):
for
txt
in
[
t
for
t
in
tree
.
_subnet_
.
_txt_
if
t
.
domain
[
1
]
==
domain
]:
for
txt
in
[
t
for
t
in
tree
.
_subnet_
.
_txt_
if
t
.
domain
[
1
]
==
domain
]:
result
+=
(
'
IN TXT
"
%s
"'
%
(
txt
.
value
[
0
]))
result
+=
(
'
IN TXT
"
%s
"'
%
(
txt
.
value
[
0
]))
pass
pass
for
srv
in
[
s
for
s
in
tree
.
_subnet_
.
_srv_
if
s
.
domain
[
1
]
==
domain
]:
s
=
{}
if
not
srv
.
name
[
0
]:
raise
util
.
HostinfoException
(
'
SRV has no name %s
'
%
srv
,
where
=
srv
)
if
not
srv
.
priority
[
0
]:
raise
util
.
HostinfoException
(
'
SRV has no priority %s
'
%
srv
,
where
=
srv
)
if
not
srv
.
weight
[
0
]:
raise
util
.
HostinfoException
(
'
SRV has no weight %s
'
%
srv
,
where
=
srv
)
if
not
srv
.
port
[
0
]:
raise
util
.
HostinfoException
(
'
SRV has no port %s
'
%
srv
,
where
=
srv
)
if
not
srv
.
host
[
0
]:
raise
util
.
HostinfoException
(
'
SRV has no host %s
'
%
srv
,
where
=
srv
)
s
[
'
name
'
]
=
srv
.
name
[
0
]
s
[
'
priority
'
]
=
srv
.
priority
[
0
]
s
[
'
weight
'
]
=
srv
.
weight
[
0
]
s
[
'
port
'
]
=
srv
.
port
[
0
]
s
[
'
host
'
]
=
srv
.
host
[
0
]
s
[
'
ttl
'
]
=
srv
.
ttl
[
0
]
or
''
result
+=
(
'
%(name)s %(ttl)s IN SRV %(priority)s %(weight)s %(port)s %(host)s
'
%
s
)
pass
result
.
append_lines
(
"""
result
.
append_lines
(
"""
|;
|;
|localhost IN A 127.0.0.1
|localhost IN A 127.0.0.1
...
...
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