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
Thomas Gambier
slapos.core
Commits
5e0344c8
Commit
5e0344c8
authored
Mar 28, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slaptool: also send computer partition AccessStatus information
parent
bce8bcb9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+21
-2
No files found.
master/product/Vifib/Tool/SlapTool.py
View file @
5e0344c8
...
@@ -958,6 +958,8 @@ class SlapTool(BaseTool):
...
@@ -958,6 +958,8 @@ class SlapTool(BaseTool):
slap_partition
.
_requested_state
=
'stopped'
slap_partition
.
_requested_state
=
'stopped'
if
state
==
"start_requested"
:
if
state
==
"start_requested"
:
slap_partition
.
_requested_state
=
'started'
slap_partition
.
_requested_state
=
'started'
slap_partition
.
_access_status
=
self
.
_getTextAccessStatus
(
software_instance
.
getReference
())
slap_partition
.
_software_release_document
=
SoftwareRelease
(
slap_partition
.
_software_release_document
=
SoftwareRelease
(
software_release
=
software_instance
.
getUrlString
().
decode
(
"UTF-8"
),
software_release
=
software_instance
.
getUrlString
().
decode
(
"UTF-8"
),
...
@@ -1117,14 +1119,30 @@ class SlapTool(BaseTool):
...
@@ -1117,14 +1119,30 @@ class SlapTool(BaseTool):
self
.
_storeLastData
(
key
,
str
(
int
(
software_instance
.
getModificationDate
())))
self
.
_storeLastData
(
key
,
str
(
int
(
software_instance
.
getModificationDate
())))
return
"OK"
return
"OK"
def
_get
AccessStatus
(
self
,
context_reference
):
def
_get
CachedAccessInfo
(
self
,
context_reference
):
memcached_dict
=
self
.
_getMemcachedDict
()
memcached_dict
=
self
.
_getMemcachedDict
()
try
:
try
:
if
context_reference
is
None
:
if
context_reference
is
None
:
raise
KeyError
raise
KeyError
else
:
else
:
d
=
memcached_dict
[
context_reference
]
d
ata
=
memcached_dict
[
context_reference
]
except
KeyError
:
except
KeyError
:
return
None
return
data
def
_getTextAccessStatus
(
self
,
context_reference
):
status_string
=
self
.
_getCachedAccessInfo
(
context_reference
)
access_status
=
"#error no data found!"
if
status_string
is
not
None
:
try
:
access_status
=
json
.
loads
(
status_string
)[
'text'
]
except
ValueError
:
pass
return
access_status
def
_getAccessStatus
(
self
,
context_reference
):
d
=
self
.
_getCachedAccessInfo
(
context_reference
)
if
d
is
None
:
if
context_reference
is
None
:
if
context_reference
is
None
:
d
=
{
d
=
{
"user"
:
"SlapOS Master"
,
"user"
:
"SlapOS Master"
,
...
@@ -1571,6 +1589,7 @@ class SlapTool(BaseTool):
...
@@ -1571,6 +1589,7 @@ class SlapTool(BaseTool):
'instance_guid'
:
software_instance
.
getReference
().
decode
(
"UTF-8"
),
'instance_guid'
:
software_instance
.
getReference
().
decode
(
"UTF-8"
),
'instance_title'
:
software_instance
.
getTitle
().
decode
(
"UTF-8"
),
'instance_title'
:
software_instance
.
getTitle
().
decode
(
"UTF-8"
),
'root_instance_title'
:
hosting_subscription
.
getTitle
().
decode
(
"UTF-8"
),
'root_instance_title'
:
hosting_subscription
.
getTitle
().
decode
(
"UTF-8"
),
'root_instance_short_title'
:
hosting_subscription
.
getShortTitle
().
decode
(
"UTF-8"
),
'xml'
:
software_instance
.
getTextContent
(),
'xml'
:
software_instance
.
getTextContent
(),
'connection_xml'
:
software_instance
.
getConnectionXml
(),
'connection_xml'
:
software_instance
.
getConnectionXml
(),
'filter_xml'
:
software_instance
.
getSlaXml
(),
'filter_xml'
:
software_instance
.
getSlaXml
(),
...
...
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