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
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
16765399
Commit
16765399
authored
Jul 02, 2012
by
Yingjie Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use getComputerInformation if getFullComputerInformation does not exist,
so it works with old versions.
parent
3a20b9bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
slapos/slap/slap.py
slapos/slap/slap.py
+12
-2
No files found.
slapos/slap/slap.py
View file @
16765399
...
@@ -207,7 +207,12 @@ def _syncComputerInformation(func):
...
@@ -207,7 +207,12 @@ 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
):
# XXX: This is a ugly way to keep backward compatibility,
# We should stablise slap library soon.
try
:
computer
=
self
.
_connection_helper
.
getFullComputerInformation
(
self
.
_computer_id
)
computer
=
self
.
_connection_helper
.
getFullComputerInformation
(
self
.
_computer_id
)
except
NotFoundError
:
computer
=
self
.
_connection_helper
.
getComputerInformation
(
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 +273,12 @@ def _syncComputerPartitionInformation(func):
...
@@ -268,7 +273,12 @@ 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
)
# XXX: This is a ugly way to keep backward compatibility,
# We should stablise slap library soon.
try
:
computer
=
self
.
_connection_helper
.
getFullComputerInformation
(
self
.
_computer_id
)
computer
=
self
.
_connection_helper
.
getFullComputerInformation
(
self
.
_computer_id
)
except
NotFoundError
:
computer
=
self
.
_connection_helper
.
getComputerInformation
(
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
():
...
...
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