Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
nexedi
/
slapos.core
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
15
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit bce8bcb9
authored
2018-03-28 18:06:12 +0200
by
Alain Takoudjou
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
slapgrid: update instance access status when checking promise anomaly
1 parent
6071d384
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
slapos/grid/slapgrid.py
slapos/slap/interface/slap.py
slapos/slap/slap.py
slapos/grid/slapgrid.py
View file @
bce8bcb
...
...
@@ -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 @
bce8bcb
...
...
@@ -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 @
bce8bcb
...
...
@@ -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
Styling with
Markdown
is supported
Attach a file
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 post a comment