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
Titouan Soulard
slapos.core
Commits
df0c78f6
Commit
df0c78f6
authored
Sep 20, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Previous merge introduced unstable state where whole slapgrid-cp could raise if one instance is bad
parent
f2b54b4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
58 deletions
+60
-58
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+60
-58
No files found.
slapos/grid/slapgrid.py
View file @
df0c78f6
...
@@ -623,11 +623,12 @@ class Slapgrid(object):
...
@@ -623,11 +623,12 @@ class Slapgrid(object):
# Process Computer Partitions
# Process Computer Partitions
clean_run
=
True
clean_run
=
True
for
computer_partition
in
self
.
getComputerPartitionList
():
for
computer_partition
in
self
.
getComputerPartitionList
():
try
:
computer_partition_id
=
computer_partition
.
getId
()
computer_partition_id
=
computer_partition
.
getId
()
try
:
try
:
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
# XXX should test status as well. But getState() returns default value.
# XXX should test status as well. But getState() returns default
# value.
except
NotFoundError
:
except
NotFoundError
:
# No Software Release information: skip.
# No Software Release information: skip.
continue
continue
...
@@ -666,7 +667,8 @@ class Slapgrid(object):
...
@@ -666,7 +667,8 @@ class Slapgrid(object):
logger
.
error
(
exception
)
logger
.
error
(
exception
)
# Check if timestamp from server is more recent than local one.
# Check if timestamp from server is more recent than local one.
# If not: it's not worth processing this partition (nothing has changed).
# If not: it's not worth processing this partition (nothing has
# changed).
if
computer_partition_id
not
in
self
.
computer_partition_filter_list
and
\
if
computer_partition_id
not
in
self
.
computer_partition_filter_list
and
\
(
not
self
.
develop
)
and
os
.
path
.
exists
(
timestamp_path
):
(
not
self
.
develop
)
and
os
.
path
.
exists
(
timestamp_path
):
old_timestamp
=
open
(
timestamp_path
).
read
()
old_timestamp
=
open
(
timestamp_path
).
read
()
...
@@ -674,14 +676,14 @@ class Slapgrid(object):
...
@@ -674,14 +676,14 @@ class Slapgrid(object):
if
timestamp
:
if
timestamp
:
try
:
try
:
if
int
(
timestamp
)
<=
int
(
old_timestamp
):
if
int
(
timestamp
)
<=
int
(
old_timestamp
):
if
int
(
time
.
time
())
<=
(
last_runtime
+
self
.
maximum_periodicity
)
:
if
int
(
time
.
time
())
<=
(
last_runtime
+
self
.
maximum_periodicity
)
:
continue
continue
except
ValueError
:
except
ValueError
:
os
.
remove
(
timestamp_path
)
os
.
remove
(
timestamp_path
)
exception
=
traceback
.
format_exc
()
exception
=
traceback
.
format_exc
()
logger
.
error
(
exception
)
logger
.
error
(
exception
)
try
:
software_path
=
os
.
path
.
join
(
self
.
software_root
,
software_path
=
os
.
path
.
join
(
self
.
software_root
,
getSoftwareUrlHash
(
software_url
))
getSoftwareUrlHash
(
software_url
))
local_partition
=
Partition
(
local_partition
=
Partition
(
...
...
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