Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Xavier Thompson
slapos.core
Commits
29dab6d9
Commit
29dab6d9
authored
Apr 05, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract .timestamp file name from code to constant.
parent
c21a2bcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+10
-3
No files found.
slapos/grid/slapgrid.py
View file @
29dab6d9
...
@@ -80,10 +80,11 @@ SLAPGRID_SUCCESS = 0
...
@@ -80,10 +80,11 @@ SLAPGRID_SUCCESS = 0
SLAPGRID_FAIL
=
1
SLAPGRID_FAIL
=
1
SLAPGRID_PROMISE_FAIL
=
2
SLAPGRID_PROMISE_FAIL
=
2
# XXX hardcoded watchdog_path
# XXX hardcoded watchdog_path
WATCHDOG_PATH
=
'/opt/slapos/bin/slapos-watchdog'
WATCHDOG_PATH
=
'/opt/slapos/bin/slapos-watchdog'
COMPUTER_PARTITION_TIMESTAMP_FILENAME
=
'.timestamp'
class
_formatXMLError
(
Exception
):
class
_formatXMLError
(
Exception
):
pass
pass
...
@@ -724,7 +725,10 @@ class Slapgrid(object):
...
@@ -724,7 +725,10 @@ class Slapgrid(object):
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
computer_partition_id
)
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
computer_partition_id
)
# Try to get partition timestamp (last modification date)
# Try to get partition timestamp (last modification date)
timestamp_path
=
os
.
path
.
join
(
instance_path
,
'.timestamp'
)
timestamp_path
=
os
.
path
.
join
(
instance_path
,
COMPUTER_PARTITION_TIMESTAMP_FILENAME
)
parameter_dict
=
computer_partition
.
getInstanceParameterDict
()
parameter_dict
=
computer_partition
.
getInstanceParameterDict
()
if
'timestamp'
in
parameter_dict
:
if
'timestamp'
in
parameter_dict
:
timestamp
=
parameter_dict
[
'timestamp'
]
timestamp
=
parameter_dict
[
'timestamp'
]
...
@@ -835,7 +839,10 @@ class Slapgrid(object):
...
@@ -835,7 +839,10 @@ class Slapgrid(object):
# If partition has been successfully processed, write timestamp
# If partition has been successfully processed, write timestamp
if
timestamp
:
if
timestamp
:
timestamp_path
=
os
.
path
.
join
(
instance_path
,
'.timestamp'
)
timestamp_path
=
os
.
path
.
join
(
instance_path
,
COMPUTER_PARTITION_TIMESTAMP_FILENAME
)
open
(
timestamp_path
,
'w'
).
write
(
timestamp
)
open
(
timestamp_path
,
'w'
).
write
(
timestamp
)
def
FilterComputerPartitionList
(
self
,
computer_partition_list
):
def
FilterComputerPartitionList
(
self
,
computer_partition_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