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
Jérome Perrin
slapos.core
Commits
a612961e
Commit
a612961e
authored
Aug 01, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
80 columns
More than 80 columns makes me kill kittens. One kitten per character.
parent
a66e8a30
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+18
-10
No files found.
slapos/grid/slapgrid.py
View file @
a612961e
...
@@ -413,12 +413,14 @@ class Slapgrid(object):
...
@@ -413,12 +413,14 @@ class Slapgrid(object):
self
.
promise_timeout
=
promise_timeout
self
.
promise_timeout
=
promise_timeout
self
.
develop
=
develop
self
.
develop
=
develop
if
software_release_filter_list
is
not
None
:
if
software_release_filter_list
is
not
None
:
self
.
software_release_filter_list
=
software_release_filter_list
.
split
(
","
)
self
.
software_release_filter_list
=
\
software_release_filter_list
.
split
(
","
)
else
:
else
:
self
.
software_release_filter_list
=
[]
self
.
software_release_filter_list
=
[]
self
.
computer_partition_filter_list
=
[]
self
.
computer_partition_filter_list
=
[]
if
computer_partition_filter_list
is
not
None
:
if
computer_partition_filter_list
is
not
None
:
self
.
computer_partition_filter_list
=
computer_partition_filter_list
.
split
(
","
)
self
.
computer_partition_filter_list
=
\
computer_partition_filter_list
.
split
(
","
)
def
checkEnvironmentAndCreateStructure
(
self
):
def
checkEnvironmentAndCreateStructure
(
self
):
"""Checks for software_root and instance_root existence, then creates
"""Checks for software_root and instance_root existence, then creates
...
@@ -443,7 +445,8 @@ class Slapgrid(object):
...
@@ -443,7 +445,8 @@ class Slapgrid(object):
updateFile
(
self
.
supervisord_configuration_path
,
updateFile
(
self
.
supervisord_configuration_path
,
pkg_resources
.
resource_stream
(
__name__
,
pkg_resources
.
resource_stream
(
__name__
,
'templates/supervisord.conf.in'
).
read
()
%
dict
(
'templates/supervisord.conf.in'
).
read
()
%
dict
(
supervisord_configuration_directory
=
self
.
supervisord_configuration_directory
,
supervisord_configuration_directory
=
\
self
.
supervisord_configuration_directory
,
supervisord_socket
=
os
.
path
.
abspath
(
self
.
supervisord_socket
),
supervisord_socket
=
os
.
path
.
abspath
(
self
.
supervisord_socket
),
supervisord_loglevel
=
'info'
,
supervisord_loglevel
=
'info'
,
supervisord_logfile
=
os
.
path
.
abspath
(
os
.
path
.
join
(
supervisord_logfile
=
os
.
path
.
abspath
(
os
.
path
.
join
(
...
@@ -762,9 +765,11 @@ class Slapgrid(object):
...
@@ -762,9 +765,11 @@ class Slapgrid(object):
xml_movements
+=
"<movement>"
xml_movements
+=
"<movement>"
for
children
in
movement
.
getchildren
():
for
children
in
movement
.
getchildren
():
if
children
.
tag
==
"reference"
:
if
children
.
tag
==
"reference"
:
xml_movements
+=
"<%s>%s</%s>"
%
(
children
.
tag
,
computer_partition_usage
.
getId
(),
children
.
tag
)
xml_movements
+=
"<%s>%s</%s>"
%
(
children
.
tag
,
computer_partition_usage
.
getId
(),
children
.
tag
)
else
:
else
:
xml_movements
+=
"<%s>%s</%s>"
%
(
children
.
tag
,
children
.
text
,
children
.
tag
)
xml_movements
+=
"<%s>%s</%s>"
%
(
children
.
tag
,
children
.
text
,
children
.
tag
)
xml_movements
+=
"</movement>"
xml_movements
+=
"</movement>"
xml_foot
=
"</transaction>"
\
xml_foot
=
"</transaction>"
\
...
@@ -858,13 +863,14 @@ class Slapgrid(object):
...
@@ -858,13 +863,14 @@ class Slapgrid(object):
process_handler
.
kill
()
process_handler
.
kill
()
if
process_handler
.
returncode
!=
0
:
if
process_handler
.
returncode
!=
0
:
clean_run
=
False
clean_run
=
False
failed_script_list
.
append
(
"Script %r failed with %s."
%
(
script
,
result
))
failed_script_list
.
append
(
"Script %r failed with %s."
%
(
script
,
result
))
logger
.
warning
(
"Failed to run %r, the result was.
\
n
%s"
%
logger
.
warning
(
"Failed to run %r, the result was.
\
n
%s"
%
(
invocation_list
,
result
))
(
invocation_list
,
result
))
if
len
(
failed_script_list
):
if
len
(
failed_script_list
):
computer_partition
.
error
(
'
\
n
'
.
join
(
failed_script_list
))
computer_partition
.
error
(
'
\
n
'
.
join
(
failed_script_list
))
#Now we loop through the different computer partitions to
ggetId()et reports
#Now we loop through the different computer partitions to
report
report_usage_issue_cp_list
=
[]
report_usage_issue_cp_list
=
[]
for
computer_partition
in
computer_partition_list
:
for
computer_partition
in
computer_partition_list
:
filename_delete_list
=
[]
filename_delete_list
=
[]
...
@@ -890,9 +896,11 @@ class Slapgrid(object):
...
@@ -890,9 +896,11 @@ class Slapgrid(object):
#We check the validity of xml content of each reports
#We check the validity of xml content of each reports
if
not
self
.
validateXML
(
usage
,
partition_consumption_model
):
if
not
self
.
validateXML
(
usage
,
partition_consumption_model
):
logger
.
info
(
'WARNING: The XML file %s generated by slapreport is not valid - '
\
logger
.
info
(
'WARNING: The XML file %s generated by slapreport is '
'This report is left as is at %s where you can inspect what went wrong '
%
(
filename
,
dir_reports
))
'not valid - This report is left as is at %s where you can '
#Warn the SlapOS Master that a partition generates corrupted xml report
'inspect what went wrong '
%
(
filename
,
dir_reports
))
# Warn the SlapOS Master that a partition generates corrupted xml
# report
else
:
else
:
computer_partition_usage
=
self
.
slap
.
registerComputerPartition
(
computer_partition_usage
=
self
.
slap
.
registerComputerPartition
(
self
.
computer_id
,
computer_partition_id
)
self
.
computer_id
,
computer_partition_id
)
...
...
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