Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.toolbox
Commits
1e24baee
Commit
1e24baee
authored
Jul 26, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
dbdb1853
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
slapos/equeue/__init__.py
slapos/equeue/__init__.py
+1
-1
slapos/networkbench/http.py
slapos/networkbench/http.py
+1
-1
slapos/resiliencytest/__init__.py
slapos/resiliencytest/__init__.py
+2
-2
slapos/resiliencytest/suites/erp5.py
slapos/resiliencytest/suites/erp5.py
+1
-1
slapos/runner/utils.py
slapos/runner/utils.py
+4
-4
slapos/runner/views.py
slapos/runner/views.py
+2
-2
No files found.
slapos/equeue/__init__.py
View file @
1e24baee
...
@@ -172,7 +172,7 @@ class EqueueServer(socketserver.ThreadingUnixStreamServer):
...
@@ -172,7 +172,7 @@ class EqueueServer(socketserver.ThreadingUnixStreamServer):
try
:
try
:
request
.
send
(
command
)
request
.
send
(
command
)
except
:
except
Exception
:
self
.
logger
.
warning
(
"Couldn't respond to %r"
,
request
.
fileno
())
self
.
logger
.
warning
(
"Couldn't respond to %r"
,
request
.
fileno
())
self
.
close_request
(
request
)
self
.
close_request
(
request
)
self
.
_runCommandIfNeeded
(
command
,
timestamp
)
self
.
_runCommandIfNeeded
(
command
,
timestamp
)
...
...
slapos/networkbench/http.py
View file @
1e24baee
...
@@ -14,7 +14,7 @@ def get_curl(buffer, url):
...
@@ -14,7 +14,7 @@ def get_curl(buffer, url):
result
=
"OK"
result
=
"OK"
try
:
try
:
curl
.
perform
()
curl
.
perform
()
except
:
except
Exception
:
import
traceback
import
traceback
traceback
.
print_exc
(
file
=
sys
.
stderr
)
traceback
.
print_exc
(
file
=
sys
.
stderr
)
sys
.
stderr
.
flush
()
sys
.
stderr
.
flush
()
...
...
slapos/resiliencytest/__init__.py
View file @
1e24baee
...
@@ -121,7 +121,7 @@ def runTestSuite(test_suite_title, test_suite_arguments, logger):
...
@@ -121,7 +121,7 @@ def runTestSuite(test_suite_title, test_suite_arguments, logger):
parsed_arguments
=
dict
(
key
.
split
(
'='
)
for
key
in
test_suite_arguments
)
parsed_arguments
=
dict
(
key
.
split
(
'='
)
for
key
in
test_suite_arguments
)
test_suite_module
=
importFrom
(
test_suite_title
)
test_suite_module
=
importFrom
(
test_suite_title
)
success
=
test_suite_module
.
runTestSuite
(
**
parsed_arguments
)
success
=
test_suite_module
.
runTestSuite
(
**
parsed_arguments
)
except
:
except
Exception
:
logger
.
exception
(
'Impossible to run resiliency test:'
)
logger
.
exception
(
'Impossible to run resiliency test:'
)
success
=
False
success
=
False
return
success
return
success
...
@@ -285,7 +285,7 @@ def runUnitTest():
...
@@ -285,7 +285,7 @@ def runUnitTest():
test_count
=
1
,
test_count
=
1
,
error_count
=
error_count
,
error_count
=
error_count
,
duration
=
test_duration
)
duration
=
test_duration
)
except
:
except
Exception
:
raise
raise
finally
:
finally
:
os
.
remove
(
fname
)
os
.
remove
(
fname
)
slapos/resiliencytest/suites/erp5.py
View file @
1e24baee
...
@@ -213,7 +213,7 @@ class ERP5TestSuite(SlaprunnerTestSuite):
...
@@ -213,7 +213,7 @@ class ERP5TestSuite(SlaprunnerTestSuite):
try
:
try
:
if
"erp5"
==
self
.
_getCreatedERP5SiteId
():
if
"erp5"
==
self
.
_getCreatedERP5SiteId
():
break
break
except
:
except
Exception
:
self
.
logger
.
info
(
"Fail to connect to erp5.... wait a bit longer"
)
self
.
logger
.
info
(
"Fail to connect to erp5.... wait a bit longer"
)
pass
pass
...
...
slapos/runner/utils.py
View file @
1e24baee
...
@@ -445,7 +445,7 @@ def svcStopAll(config):
...
@@ -445,7 +445,7 @@ def svcStopAll(config):
try
:
try
:
return
Popen
([
config
[
'slapos'
],
'node'
,
'supervisorctl'
,
'--cfg'
,
config
[
'configuration_file_path'
],
return
Popen
([
config
[
'slapos'
],
'node'
,
'supervisorctl'
,
'--cfg'
,
config
[
'configuration_file_path'
],
'stop'
,
'all'
]).
communicate
()[
0
]
'stop'
,
'all'
]).
communicate
()[
0
]
except
:
except
Exception
:
pass
pass
def
svcStartAll
(
config
):
def
svcStartAll
(
config
):
...
@@ -453,7 +453,7 @@ def svcStartAll(config):
...
@@ -453,7 +453,7 @@ def svcStartAll(config):
try
:
try
:
return
Popen
([
config
[
'slapos'
],
'node'
,
'supervisorctl'
,
'--cfg'
,
config
[
'configuration_file_path'
],
return
Popen
([
config
[
'slapos'
],
'node'
,
'supervisorctl'
,
'--cfg'
,
config
[
'configuration_file_path'
],
'start'
,
'all'
]).
communicate
()[
0
]
'start'
,
'all'
]).
communicate
()[
0
]
except
:
except
Exception
:
pass
pass
def
removeInstanceRootDirectory
(
config
):
def
removeInstanceRootDirectory
(
config
):
...
@@ -601,7 +601,7 @@ def newSoftware(folder, config, session):
...
@@ -601,7 +601,7 @@ def newSoftware(folder, config, session):
softwareContent = ""
softwareContent = ""
try:
try:
softwareContent = urlopen(software).read()
softwareContent = urlopen(software).read()
except:
except
Exception
:
#Software.cfg and instance.cfg content will be empty
#Software.cfg and instance.cfg content will be empty
pass
pass
with open(os.path.join(folderPath, config['
software_profile
']), '
w
') as f:
with open(os.path.join(folderPath, config['
software_profile
']), '
w
') as f:
...
@@ -799,7 +799,7 @@ def md5sum(file):
...
@@ -799,7 +799,7 @@ def md5sum(file):
break
break
m.update(data)
m.update(data)
return m.hexdigest()
return m.hexdigest()
except:
except
Exception
:
return False
return False
...
...
slapos/runner/views.py
View file @
1e24baee
...
@@ -259,7 +259,7 @@ def getFileLog():
...
@@ -259,7 +259,7 @@ def getFileLog():
with
open
(
file_path
)
as
f
:
with
open
(
file_path
)
as
f
:
content
=
f
.
read
()
content
=
f
.
read
()
return
jsonify
(
code
=
1
,
result
=
html_escape
(
content
))
return
jsonify
(
code
=
1
,
result
=
html_escape
(
content
))
except
:
except
Exception
:
return
jsonify
(
code
=
0
,
result
=
"Warning: Log file doesn't exist yet or empty log!!"
)
return
jsonify
(
code
=
0
,
result
=
"Warning: Log file doesn't exist yet or empty log!!"
)
...
@@ -717,7 +717,7 @@ def fileBrowser():
...
@@ -717,7 +717,7 @@ def fileBrowser():
filename
)
filename
)
try
:
try
:
return
send_file
(
result
,
attachment_filename
=
filename
,
as_attachment
=
True
)
return
send_file
(
result
,
attachment_filename
=
filename
,
as_attachment
=
True
)
except
:
except
Exception
:
abort
(
404
)
abort
(
404
)
elif
opt
==
9
:
elif
opt
==
9
:
result
=
file_request
.
readFile
(
dir
,
filename
,
False
)
result
=
file_request
.
readFile
(
dir
,
filename
,
False
)
...
...
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