Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Am I live
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
shore
Am I live
Commits
45cd7f76
Commit
45cd7f76
authored
4 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Output exceptions.
Ease debugging.
parent
90b0dbe8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/_dns.py
+6
-3
6 additions, 3 deletions
src/_dns.py
src/utils.py
+2
-1
2 additions, 1 deletion
src/utils.py
with
8 additions
and
4 deletions
src/_dns.py
+
6
−
3
View file @
45cd7f76
...
...
@@ -41,7 +41,8 @@ def validate_soa():
try
:
r
=
soas
.
pop
()
r
.
mname
.
to_text
()
except
Exception
:
# pylint: disable=broad-except
except
Exception
as
e
:
# pylint: disable=broad-except
print
(
str
(
e
))
return
[
False
,
"
SOA record is invalid.
"
]
return
[
True
,
"
SOA record validated.
"
]
...
...
@@ -58,7 +59,8 @@ def validate_mx():
ips
=
cross_query
(
r
.
exchange
.
to_text
())
if
len
(
ips
)
>
1
:
return
[
False
,
"
MX records don
'
t match.
"
]
except
Exception
:
# pylint: disable=broad-except
except
Exception
as
e
:
# pylint: disable=broad-except
print
(
str
(
e
))
return
[
False
,
"
MX record is invalid.
"
]
return
[
True
,
"
MX record validated.
"
]
...
...
@@ -71,7 +73,8 @@ def validate_subdomains():
ips
=
cross_query
(
d
)
if
len
(
ips
)
>
1
:
return
[
True
,
f
"
Domain
{
d
}
records don
'
t match.
"
]
except
Exception
:
# pylint: disable=broad-except
except
Exception
as
e
:
# pylint: disable=broad-except
print
(
str
(
e
))
return
[
False
,
"
Failed to validate domain {d}.
"
]
return
[
True
,
"
Subdomains validated.
"
]
...
...
This diff is collapsed.
Click to expand it.
src/utils.py
+
2
−
1
View file @
45cd7f76
...
...
@@ -20,7 +20,8 @@ def check_url(url, method="GET", valid_codes=(200)):
try
:
response
=
requests
.
request
(
method
,
url
,
allow_redirects
=
False
)
return
response
.
status_code
in
valid_codes
except
Exception
:
# pylint: disable=broad-except
except
Exception
as
e
:
# pylint: disable=broad-except,invalid-name
print
(
str
(
e
))
return
False
...
...
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