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
Léo-Paul Géneau
slapos.core
Commits
bce8bcb9
Commit
bce8bcb9
authored
Mar 28, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: update instance access status when checking promise anomaly
parent
6071d384
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+18
-3
slapos/slap/interface/slap.py
slapos/slap/interface/slap.py
+3
-0
slapos/slap/slap.py
slapos/slap/slap.py
+4
-0
No files found.
slapos/grid/slapgrid.py
View file @
bce8bcb9
...
...
@@ -906,6 +906,23 @@ stderr_logfile_backups=1
self
.
_checkAddFirewallRules
(
computer_partition
.
getId
(),
cmd_list
,
add
=
add_rules
)
def
_checkPromiseAnomaly
(
self
,
local_partition
,
computer_partition
):
partition_access_status
=
computer_partition
.
getAccessStatus
()
status_error
=
False
if
partition_access_status
and
partition_access_status
.
startswith
(
"#error"
):
status_error
=
True
try
:
self
.
_checkPromiseList
(
local_partition
,
check_anomaly
=
True
,
force
=
False
)
except
PromiseError
,
e
:
if
not
status_error
:
self
.
logger
.
error
(
e
)
computer_partition
.
error
(
e
,
logger
=
self
.
logger
)
else
:
if
status_error
:
computer_partition
.
started
()
def
processComputerPartition
(
self
,
computer_partition
):
"""
Process a Computer Partition, depending on its state
...
...
@@ -1018,9 +1035,7 @@ stderr_logfile_backups=1
# check promises anomaly
if
computer_partition_state
==
COMPUTER_PARTITION_STARTED_STATE
:
self
.
logger
.
debug
(
'Partition already up-to-date.'
)
self
.
_checkPromiseList
(
local_partition
,
check_anomaly
=
True
,
force
=
False
)
self
.
_checkPromiseAnomaly
(
local_partition
,
computer_partition
)
else
:
self
.
logger
.
debug
(
'Partition already up-to-date. skipping.'
)
return
...
...
slapos/slap/interface/slap.py
View file @
bce8bcb9
...
...
@@ -227,6 +227,9 @@ class IComputerPartition(IBuildoutController, IRequester):
The result can be: started, stopped, destroyed
"""
def
getAccessStatus
():
"""Get latest computer partition Access message state"""
def
getSoftwareRelease
():
"""
Returns the software release associate to the computer partition.
...
...
slapos/slap/slap.py
View file @
bce8bcb9
...
...
@@ -564,6 +564,10 @@ class ComputerPartition(SlapRequester):
raise
ResourceNotReady
()
return
self
.
_requested_state
def
getAccessStatus
(
self
):
"""Get latest computer partition Access message state"""
return
getattr
(
self
,
'_access_status'
,
None
)
def
getType
(
self
):
"""
return the Software Type of the instance.
...
...
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