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
Nicolas Wavrant
slapos.core
Commits
eae9e1e5
Commit
eae9e1e5
authored
Jun 29, 2012
by
Yingjie Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use full computer information, ready to use promise based client setting.
parent
23b53d55
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
slapos/slap/slap.py
slapos/slap/slap.py
+6
-2
No files found.
slapos/slap/slap.py
View file @
eae9e1e5
...
@@ -207,7 +207,7 @@ def _syncComputerInformation(func):
...
@@ -207,7 +207,7 @@ def _syncComputerInformation(func):
Synchronize computer object with server information
Synchronize computer object with server information
"""
"""
def
decorated
(
self
,
*
args
,
**
kw
):
def
decorated
(
self
,
*
args
,
**
kw
):
computer
=
self
.
_connection_helper
.
getComputerInformation
(
self
.
_computer_id
)
computer
=
self
.
_connection_helper
.
get
Full
ComputerInformation
(
self
.
_computer_id
)
for
key
,
value
in
computer
.
__dict__
.
items
():
for
key
,
value
in
computer
.
__dict__
.
items
():
if
isinstance
(
value
,
unicode
):
if
isinstance
(
value
,
unicode
):
# convert unicode to utf-8
# convert unicode to utf-8
...
@@ -268,7 +268,7 @@ def _syncComputerPartitionInformation(func):
...
@@ -268,7 +268,7 @@ def _syncComputerPartitionInformation(func):
def
decorated
(
self
,
*
args
,
**
kw
):
def
decorated
(
self
,
*
args
,
**
kw
):
if
getattr
(
self
,
'_synced'
,
0
):
if
getattr
(
self
,
'_synced'
,
0
):
return
func
(
self
,
*
args
,
**
kw
)
return
func
(
self
,
*
args
,
**
kw
)
computer
=
self
.
_connection_helper
.
getComputerInformation
(
self
.
_computer_id
)
computer
=
self
.
_connection_helper
.
get
Full
ComputerInformation
(
self
.
_computer_id
)
found_computer_partition
=
None
found_computer_partition
=
None
for
computer_partition
in
computer
.
_computer_partition_list
:
for
computer_partition
in
computer
.
_computer_partition_list
:
if
computer_partition
.
getId
()
==
self
.
getId
():
if
computer_partition
.
getId
()
==
self
.
getId
():
...
@@ -517,6 +517,10 @@ class ConnectionHelper:
...
@@ -517,6 +517,10 @@ class ConnectionHelper:
self
.
GET
(
'/getComputerInformation?computer_id=%s'
%
computer_id
)
self
.
GET
(
'/getComputerInformation?computer_id=%s'
%
computer_id
)
return
xml_marshaller
.
loads
(
self
.
response
.
read
())
return
xml_marshaller
.
loads
(
self
.
response
.
read
())
def
getFullComputerInformation
(
self
,
computer_id
):
self
.
GET
(
'/getFullComputerInformation?computer_id=%s'
%
computer_id
)
return
xml_marshaller
.
loads
(
self
.
response
.
read
())
def
connect
(
self
):
def
connect
(
self
):
connection_dict
=
dict
(
connection_dict
=
dict
(
host
=
self
.
host
)
host
=
self
.
host
)
...
...
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