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
Arnaud Véron
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
Show 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):
...
@@ -236,10 +236,8 @@ class Software(object):
else
:
else
:
self
.
logger
.
info
(
'Path %r does not exists, no need to remove.'
%
self
.
logger
.
info
(
'Path %r does not exists, no need to remove.'
%
self
.
software_path
)
self
.
software_path
)
except
IOError
as
error
:
except
IOError
as
exc
:
error_string
=
"I/O error while removing software (%s): %s"
%
(
self
.
url
,
raise
IOError
(
"I/O error while removing software (%s): %s"
%
(
self
.
url
,
exc
))
error
)
raise
IOError
(
error_string
)
class
Partition
(
object
):
class
Partition
(
object
):
...
@@ -368,10 +366,10 @@ class Partition(object):
...
@@ -368,10 +366,10 @@ class Partition(object):
self
.
logger
.
debug
(
"Copying %r to %r"
%
(
template_location
,
config_location
))
self
.
logger
.
debug
(
"Copying %r to %r"
%
(
template_location
,
config_location
))
try
:
try
:
shutil
.
copy
(
template_location
,
config_location
)
shutil
.
copy
(
template_location
,
config_location
)
except
IOError
as
e
:
except
IOError
as
e
xc
:
# Template not found on SR, we notify user.
# Template not found on SR, we notify user.
raise
IOError
(
'Software Release %s is not correctly installed.
\
n
'
raise
IOError
(
'Software Release %s is not correctly installed.
\
n
%s'
%
(
'%s'
%
(
self
.
software_release_url
,
e
))
self
.
software_release_url
,
exc
))
# fill generated buildout with additional information
# fill generated buildout with additional information
buildout_text
=
open
(
config_location
).
read
()
buildout_text
=
open
(
config_location
).
read
()
buildout_text
+=
'
\
n
\
n
'
+
pkg_resources
.
resource_string
(
__name__
,
buildout_text
+=
'
\
n
\
n
'
+
pkg_resources
.
resource_string
(
__name__
,
...
@@ -480,8 +478,8 @@ class Partition(object):
...
@@ -480,8 +478,8 @@ class Partition(object):
partition_id
=
self
.
computer_partition
.
getId
()
partition_id
=
self
.
computer_partition
.
getId
()
try
:
try
:
supervisor
.
startProcessGroup
(
partition_id
,
False
)
supervisor
.
startProcessGroup
(
partition_id
,
False
)
except
xmlrpclib
.
Fault
as
e
:
except
xmlrpclib
.
Fault
as
e
xc
:
if
e
.
faultString
.
startswith
(
'BAD_NAME:'
):
if
e
xc
.
faultString
.
startswith
(
'BAD_NAME:'
):
self
.
logger
.
info
(
"Nothing to start on %s..."
%
self
.
logger
.
info
(
"Nothing to start on %s..."
%
self
.
computer_partition
.
getId
())
self
.
computer_partition
.
getId
())
else
:
else
:
...
@@ -493,8 +491,8 @@ class Partition(object):
...
@@ -493,8 +491,8 @@ class Partition(object):
try
:
try
:
supervisor
=
self
.
getSupervisorRPC
()
supervisor
=
self
.
getSupervisorRPC
()
supervisor
.
stopProcessGroup
(
partition_id
,
False
)
supervisor
.
stopProcessGroup
(
partition_id
,
False
)
except
xmlrpclib
.
Fault
as
e
:
except
xmlrpclib
.
Fault
as
e
xc
:
if
e
.
faultString
.
startswith
(
'BAD_NAME:'
):
if
e
xc
.
faultString
.
startswith
(
'BAD_NAME:'
):
self
.
logger
.
info
(
'Partition %s not known in supervisord, ignoring'
%
partition_id
)
self
.
logger
.
info
(
'Partition %s not known in supervisord, ignoring'
%
partition_id
)
else
:
else
:
self
.
logger
.
info
(
"Requested stop of %s..."
%
self
.
computer_partition
.
getId
())
self
.
logger
.
info
(
"Requested stop of %s..."
%
self
.
computer_partition
.
getId
())
...
@@ -541,10 +539,8 @@ class Partition(object):
...
@@ -541,10 +539,8 @@ class Partition(object):
if
os
.
path
.
exists
(
self
.
supervisord_partition_configuration_path
):
if
os
.
path
.
exists
(
self
.
supervisord_partition_configuration_path
):
os
.
remove
(
self
.
supervisord_partition_configuration_path
)
os
.
remove
(
self
.
supervisord_partition_configuration_path
)
self
.
updateSupervisor
()
self
.
updateSupervisor
()
except
IOError
as
error
:
except
IOError
as
exc
:
error_string
=
"I/O error while freeing partition (%s): %s"
\
raise
IOError
(
"I/O error while freeing partition (%s): %s"
%
(
self
.
instance_path
,
exc
))
%
(
self
.
instance_path
,
error
)
raise
IOError
(
error_string
)
def
fetchInformations
(
self
):
def
fetchInformations
(
self
):
"""Fetch usage informations with buildout, returns it.
"""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