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
Boxiang Sun
slapos.core
Commits
34a9e7ae
Commit
34a9e7ae
authored
Jan 28, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep running if cp.error() or sr.error() have issues (fixes 20130119-744D94)
parent
47723afa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
slapos/slap/slap.py
slapos/slap/slap.py
+24
-12
No files found.
slapos/slap/slap.py
View file @
34a9e7ae
...
@@ -26,6 +26,10 @@
...
@@ -26,6 +26,10 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
##############################################################################
##############################################################################
"""
Simple, easy to (un)marshall classes for slap client/server communication
"""
__all__
=
[
"slap"
,
"ComputerPartition"
,
"Computer"
,
"SoftwareRelease"
,
__all__
=
[
"slap"
,
"ComputerPartition"
,
"Computer"
,
"SoftwareRelease"
,
"Supply"
,
"OpenOrder"
,
"NotFoundError"
,
"Unauthorized"
,
"Supply"
,
"OpenOrder"
,
"NotFoundError"
,
"Unauthorized"
,
"ResourceNotReady"
,
"ServerError"
]
"ResourceNotReady"
,
"ServerError"
]
...
@@ -33,15 +37,15 @@ __all__ = ["slap", "ComputerPartition", "Computer", "SoftwareRelease",
...
@@ -33,15 +37,15 @@ __all__ = ["slap", "ComputerPartition", "Computer", "SoftwareRelease",
from
interface
import
slap
as
interface
from
interface
import
slap
as
interface
from
xml_marshaller
import
xml_marshaller
from
xml_marshaller
import
xml_marshaller
import
httplib
import
httplib
import
logging
import
socket
import
socket
import
ssl
import
ssl
import
traceback
import
urllib
import
urllib
import
urlparse
import
urlparse
import
zope.interface
import
zope.interface
"""
log
=
logging
.
getLogger
(
__name__
)
Simple, easy to (un)marshall classes for slap client/server communication
"""
DEFAULT_SOFTWARE_TYPE
=
'default'
DEFAULT_SOFTWARE_TYPE
=
'default'
...
@@ -109,11 +113,15 @@ class SoftwareRelease(SlapDocument):
...
@@ -109,11 +113,15 @@ class SoftwareRelease(SlapDocument):
return
self
.
_software_release
return
self
.
_software_release
def
error
(
self
,
error_log
):
def
error
(
self
,
error_log
):
# Does not follow interface
try
:
self
.
_connection_helper
.
POST
(
'/softwareReleaseError'
,
{
# Does not follow interface
'url'
:
self
.
getURI
(),
self
.
_connection_helper
.
POST
(
'/softwareReleaseError'
,
{
'computer_id'
:
self
.
getComputerId
(),
'url'
:
self
.
getURI
(),
'error_log'
:
error_log
})
'computer_id'
:
self
.
getComputerId
(),
'error_log'
:
error_log
})
except
Exception
:
exception
=
traceback
.
format_exc
()
log
.
error
(
exception
)
def
available
(
self
):
def
available
(
self
):
self
.
_connection_helper
.
POST
(
'/availableSoftwareRelease'
,
{
self
.
_connection_helper
.
POST
(
'/availableSoftwareRelease'
,
{
...
@@ -469,10 +477,14 @@ class ComputerPartition(SlapDocument):
...
@@ -469,10 +477,14 @@ class ComputerPartition(SlapDocument):
})
})
def
error
(
self
,
error_log
):
def
error
(
self
,
error_log
):
self
.
_connection_helper
.
POST
(
'/softwareInstanceError'
,
{
try
:
'computer_id'
:
self
.
_computer_id
,
self
.
_connection_helper
.
POST
(
'/softwareInstanceError'
,
{
'computer_partition_id'
:
self
.
getId
(),
'computer_id'
:
self
.
_computer_id
,
'error_log'
:
error_log
})
'computer_partition_id'
:
self
.
getId
(),
'error_log'
:
error_log
})
except
Exception
:
exception
=
traceback
.
format_exc
()
log
.
error
(
exception
)
def
bang
(
self
,
message
):
def
bang
(
self
,
message
):
self
.
_connection_helper
.
POST
(
'/softwareInstanceBang'
,
{
self
.
_connection_helper
.
POST
(
'/softwareInstanceBang'
,
{
...
...
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