Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.toolbox
Commits
cbecd39f
Commit
cbecd39f
authored
Feb 15, 2024
by
Łukasz Nowak
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check_surykatka_json: Fix support for missing expiration_date
parent
35f71746
Pipeline
#32835
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
slapos/promise/plugin/check_surykatka_json.py
slapos/promise/plugin/check_surykatka_json.py
+2
-1
slapos/test/promise/plugin/test_check_surykatka_json.py
slapos/test/promise/plugin/test_check_surykatka_json.py
+15
-0
No files found.
slapos/promise/plugin/check_surykatka_json.py
View file @
cbecd39f
...
...
@@ -304,7 +304,8 @@ class RunPromise(GenericPromise):
entry
=
entry_list
[
0
]
expiration_date
=
entry
[
'expiration_date'
]
if
expiration_date
is
None
:
self
.
appendError
(
'Expiration date not avaliable'
)
self
.
appendError
(
'%s expiration date not avaliable'
%
(
entry
[
'domain'
],))
return
timetuple
=
email
.
utils
.
parsedate
(
expiration_date
)
if
timetuple
is
None
:
self
.
appendError
(
"Can't parse date %s"
%
(
expiration_date
,))
...
...
slapos/test/promise/plugin/test_check_surykatka_json.py
View file @
cbecd39f
...
...
@@ -585,6 +585,10 @@ class TestCheckSurykatkaJSONHttpQueryWhois(CheckSurykatkaJSONMixin):
"domain"
:
"whoisminus29.com"
,
"expiration_date"
:
self
.
time_past29d
},
{
"domain"
:
"whoisnone.com"
,
"expiration_date"
:
None
},
]
})
...
...
@@ -662,6 +666,17 @@ class TestCheckSurykatkaJSONHttpQueryWhois(CheckSurykatkaJSONMixin):
"whois: ERROR whoisminus29.com expires in < 30 days"
)
def
test_none
(
self
):
self
.
writeSurykatkaPromise
(
{
'url'
:
'https://www.whoisnone.com/'
,
}
)
self
.
runAndAssertFailedMessage
(
"https://www.whoisnone.com/ : "
"whois: ERROR whoisnone.com expiration date not avaliable"
)
class
TestCheckSurykatkaJSONHttpQueryTcpServer
(
CheckSurykatkaJSONMixin
):
def
setUp
(
self
):
...
...
Kirill Smelkov
@kirr
mentioned in merge request
!131 (closed)
·
Feb 15, 2024
mentioned in merge request
!131 (closed)
mentioned in merge request !131
Toggle commit list
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