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
Eric Zheng
slapos.core
Commits
985c7417
Commit
985c7417
authored
Apr 25, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed short lived string objects
parent
782aad7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+11
-15
No files found.
slapos/grid/SlapObject.py
View file @
985c7417
...
...
@@ -236,10 +236,8 @@ class Software(object):
else
:
self
.
logger
.
info
(
'Path %r does not exists, no need to remove.'
%
self
.
software_path
)
except
IOError
as
error
:
error_string
=
"I/O error while removing software (%s): %s"
%
(
self
.
url
,
error
)
raise
IOError
(
error_string
)
except
IOError
as
exc
:
raise
IOError
(
"I/O error while removing software (%s): %s"
%
(
self
.
url
,
exc
))
class
Partition
(
object
):
...
...
@@ -368,10 +366,10 @@ class Partition(object):
self
.
logger
.
debug
(
"Copying %r to %r"
%
(
template_location
,
config_location
))
try
:
shutil
.
copy
(
template_location
,
config_location
)
except
IOError
as
e
:
except
IOError
as
e
xc
:
# Template not found on SR, we notify user.
raise
IOError
(
'Software Release %s is not correctly installed.
\
n
'
'%s'
%
(
self
.
software_release_url
,
e
))
raise
IOError
(
'Software Release %s is not correctly installed.
\
n
%s'
%
(
self
.
software_release_url
,
exc
))
# fill generated buildout with additional information
buildout_text
=
open
(
config_location
).
read
()
buildout_text
+=
'
\
n
\
n
'
+
pkg_resources
.
resource_string
(
__name__
,
...
...
@@ -480,8 +478,8 @@ class Partition(object):
partition_id
=
self
.
computer_partition
.
getId
()
try
:
supervisor
.
startProcessGroup
(
partition_id
,
False
)
except
xmlrpclib
.
Fault
as
e
:
if
e
.
faultString
.
startswith
(
'BAD_NAME:'
):
except
xmlrpclib
.
Fault
as
e
xc
:
if
e
xc
.
faultString
.
startswith
(
'BAD_NAME:'
):
self
.
logger
.
info
(
"Nothing to start on %s..."
%
self
.
computer_partition
.
getId
())
else
:
...
...
@@ -493,8 +491,8 @@ class Partition(object):
try
:
supervisor
=
self
.
getSupervisorRPC
()
supervisor
.
stopProcessGroup
(
partition_id
,
False
)
except
xmlrpclib
.
Fault
as
e
:
if
e
.
faultString
.
startswith
(
'BAD_NAME:'
):
except
xmlrpclib
.
Fault
as
e
xc
:
if
e
xc
.
faultString
.
startswith
(
'BAD_NAME:'
):
self
.
logger
.
info
(
'Partition %s not known in supervisord, ignoring'
%
partition_id
)
else
:
self
.
logger
.
info
(
"Requested stop of %s..."
%
self
.
computer_partition
.
getId
())
...
...
@@ -541,10 +539,8 @@ class Partition(object):
if
os
.
path
.
exists
(
self
.
supervisord_partition_configuration_path
):
os
.
remove
(
self
.
supervisord_partition_configuration_path
)
self
.
updateSupervisor
()
except
IOError
as
error
:
error_string
=
"I/O error while freeing partition (%s): %s"
\
%
(
self
.
instance_path
,
error
)
raise
IOError
(
error_string
)
except
IOError
as
exc
:
raise
IOError
(
"I/O error while freeing partition (%s): %s"
%
(
self
.
instance_path
,
exc
))
def
fetchInformations
(
self
):
"""Fetch usage informations with buildout, returns it.
...
...
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