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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
slapos.toolbox
Commits
0b0a0536
Commit
0b0a0536
authored
Dec 11, 2018
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[backupserver promise] The cron date is actually in the system's timezone
parent
90cad43d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
setup.py
setup.py
+1
-0
slapos/promise/plugin/backupserver_check_backup.py
slapos/promise/plugin/backupserver_check_backup.py
+4
-1
No files found.
setup.py
View file @
0b0a0536
...
...
@@ -48,6 +48,7 @@ setup(name=name,
'GitPython'
,
#needed for git manipulation into slaprunner
'croniter'
,
# needed to know cron schedule
'pytz'
,
# needed to manipulate timezone
'tzlocal'
,
# needed to manipulate timezone
'passlib'
,
'netifaces'
,
'erp5.util'
,
...
...
slapos/promise/plugin/backupserver_check_backup.py
View file @
0b0a0536
...
...
@@ -10,6 +10,7 @@ from os.path import isfile, getmtime
from
datetime
import
datetime
from
croniter
import
croniter
from
dateutil.parser
import
parse
from
tzlocal
import
get_localzone
class
RunPromise
(
GenericPromise
):
...
...
@@ -34,7 +35,9 @@ class RunPromise(GenericPromise):
script
=
self
.
getConfig
(
'script_fullpath'
)
status
=
self
.
getConfig
(
'status_fullpath'
)
prev_cron
=
croniter
(
self
.
getConfig
(
'cron_frequency'
),
datetime
.
now
(
pytz
.
utc
)).
get_prev
(
datetime
)
# date of the previous time cron launched
local_tz
=
get_localzone
()
prev_cron
=
croniter
(
self
.
getConfig
(
'cron_frequency'
),
datetime
.
now
()).
get_prev
(
datetime
)
# date of the previous time cron launched
prev_cron
=
local_tz
.
localize
(
prev_cron
)
status_url
=
"{}/private/{}/{}"
.
format
(
self
.
getConfig
(
"monitor_url"
),
self
.
getConfig
(
"status_dirbasename"
),
self
.
getConfig
(
"status_name"
))
statistic_url
=
"{}/private/{}/{}"
.
format
(
self
.
getConfig
(
"monitor_url"
),
self
.
getConfig
(
"statistic_dirbasename"
),
self
.
getConfig
(
"statistic_name"
))
...
...
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