Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Léo-Paul Géneau
erp5
Commits
411cc48a
Commit
411cc48a
authored
May 13, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: clean up trailing spaces
parent
97af85f9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+10
-10
erp5/util/testnode/SlapOSMasterCommunicator.py
erp5/util/testnode/SlapOSMasterCommunicator.py
+5
-5
erp5/util/testnode/UnitTestRunner.py
erp5/util/testnode/UnitTestRunner.py
+1
-1
erp5/util/testnode/Updater.py
erp5/util/testnode/Updater.py
+1
-1
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+2
-2
No files found.
erp5/util/testnode/SlapOSControler.py
View file @
411cc48a
...
...
@@ -116,7 +116,7 @@ class SlapOSControler(object):
reference : instance title
software_url : software path/url
software_type : scalability
software_configuration : dict { "_" : "{'toto' : 'titi'}" }
software_configuration : dict { "_" : "{'toto' : 'titi'}" }
Ex :
my_controler._request('Instance16h34Ben',
...
...
@@ -170,22 +170,22 @@ class SlapOSControler(object):
self
.
instance_config
[
reference
][
'software_configuration'
],
self
.
instance_config
[
reference
][
'computer_guid'
],
state
=
state
)
)
def
destroyInstance
(
self
,
reference
):
logger
.
debug
(
'SlapOSControler : delete instance'
)
try
:
self
.
_requestSpecificState
(
reference
,
'destroyed'
)
except
Exception
:
raise
ValueError
(
"Can't delete instance %r (instance not created?)"
%
reference
)
def
stopInstance
(
self
,
reference
):
logger
.
debug
(
'SlapOSControler : stop instance'
)
try
:
self
.
_requestSpecificState
(
reference
,
'stopped'
)
except
Exception
:
raise
ValueError
(
"Can't stop instance %r (instance not created?)"
%
reference
)
def
startInstance
(
self
,
reference
):
logger
.
debug
(
'SlapOSControler : start instance'
)
try
:
...
...
@@ -242,7 +242,7 @@ class SlapOSControler(object):
slapproxy_log_fp
=
open
(
slapproxy_log
,
'w'
)
kwargs
[
'stdout'
]
=
slapproxy_log_fp
kwargs
[
'stderr'
]
=
slapproxy_log_fp
proxy
=
subprocess
.
Popen
([
config
[
'slapos_binary'
],
proxy
=
subprocess
.
Popen
([
config
[
'slapos_binary'
],
'proxy'
,
'start'
,
'--cfg'
,
self
.
slapos_config
],
**
kwargs
)
process_manager
.
process_pid_set
.
add
(
proxy
.
pid
)
...
...
@@ -338,7 +338,7 @@ class SlapOSControler(object):
# so be tolerant and run it a few times before giving up
for
_
in
range
(
MAX_SR_RETRIES
):
status_dict
=
self
.
spawn
(
config
[
'slapos_binary'
],
'node'
,
'software'
,
'--all'
,
'node'
,
'software'
,
'--all'
,
'--pidfile'
,
os
.
path
.
join
(
self
.
software_root
,
'slapos-node.pid'
),
'--cfg'
,
self
.
slapos_config
,
raise_error_if_fail
=
False
,
log_prefix
=
'slapgrid_sr'
,
get_output
=
False
)
...
...
@@ -361,11 +361,11 @@ class SlapOSControler(object):
logger
.
exception
(
"SlapOSControler.runComputerPartition"
)
raise
ValueError
(
"Unable to registerOpenOrder"
)
# try to run for all partitions as one partition may in theory request another one
# try to run for all partitions as one partition may in theory request another one
# this not always is required but currently no way to know how "tree" of partitions
# may "expand"
for
_
in
range
(
max_quantity
):
status_dict
=
self
.
spawn
(
config
[
'slapos_binary'
],
'node'
,
'instance'
,
status_dict
=
self
.
spawn
(
config
[
'slapos_binary'
],
'node'
,
'instance'
,
'--pidfile'
,
os
.
path
.
join
(
self
.
instance_root
,
'slapos-node.pid'
),
'--cfg'
,
self
.
slapos_config
,
raise_error_if_fail
=
False
,
log_prefix
=
'slapgrid_cp'
,
get_output
=
False
)
...
...
@@ -377,4 +377,4 @@ class SlapOSControler(object):
# codes, but depending on slapos versions, we have inconsistent status
if
status_dict
[
'status_code'
]
in
(
1
,
2
):
status_dict
[
'status_code'
]
=
0
return
status_dict
\ No newline at end of file
return
status_dict
erp5/util/testnode/SlapOSMasterCommunicator.py
View file @
411cc48a
...
...
@@ -81,7 +81,7 @@ class SlapOSMasterCommunicator(object):
except
AttributeError
as
e
:
logger
.
warning
(
'Error on get software release: %s '
,
e
.
message
)
self
.
url
=
url
self
.
url
=
url
#########################################################
# Wrapper functions to support network retries
...
...
@@ -98,7 +98,7 @@ class SlapOSMasterCommunicator(object):
@
retryOnNetworkFailure
def
_request
(
self
,
state
,
instance_title
=
None
,
request_kw
=
None
,
shared
=
False
,
software_type
=
"RootSoftwareInstance"
):
if
instance_title
is
not
None
:
self
.
name
=
instance_title
self
.
name
=
instance_title
if
request_kw
is
not
None
:
if
isinstance
(
request_kw
,
bytes
):
self
.
request_kw
=
json
.
loads
(
request_kw
.
decode
(
'utf-8'
))
...
...
@@ -386,7 +386,7 @@ class SlapOSTester(SlapOSMasterCommunicator):
logger
.
info
(
"balancer ipv6 url not generated yet for instance: "
+
instance
[
"title"
])
pass
# get generated by Nexedi's CDN frontend address
# get generated by Nexedi's CDN frontend address
if
"frontend-"
in
instance
[
"title"
]:
try
:
frontend
=
[
instance
[
"title"
].
replace
(
"frontend-"
,
""
),
...
...
@@ -504,7 +504,7 @@ class SoftwareReleaseTester(SlapOSTester):
for
prop
in
entry
:
if
prop
!=
"information"
:
message
+=
"%s = %s
\
n
"
%
(
prop
,
json
.
dumps
(
entry
[
prop
],
indent
=
2
))
message
+=
"=== connection_dict ===
\
n
%s
\
n
"
%
(
json
.
dumps
(
entry
[
"information"
][
"connection_dict"
],
indent
=
2
))
message
+=
"
\
n
"
...
...
@@ -513,7 +513,7 @@ class SoftwareReleaseTester(SlapOSTester):
message
+=
"
\
n
"
message
+=
"="
*
79
message
+=
"
\
n
\
n
\
n
"
return
summary
+
message
@
retryOnNetworkFailure
...
...
erp5/util/testnode/UnitTestRunner.py
View file @
411cc48a
...
...
@@ -209,4 +209,4 @@ class UnitTestRunner(object):
Used by the method testnode.constructProfile() to know
if the software.cfg have to use relative path or not.
"""
return
False
\ No newline at end of file
return
False
erp5/util/testnode/Updater.py
View file @
411cc48a
...
...
@@ -90,7 +90,7 @@ class Updater(object):
cwd = kw.pop("cwd", None)
if cwd is None:
cwd = self.getRepositoryPath()
return self.process_manager.spawn(*args,
return self.process_manager.spawn(*args,
log_prefix='
git
',
cwd=cwd,
**kw)
...
...
erp5/util/testnode/testnode.py
View file @
411cc48a
...
...
@@ -75,7 +75,7 @@ class TestNode(object):
rmtree
(
fpath
)
else
:
os
.
remove
(
fpath
)
def
getNodeTestSuite
(
self
,
reference
):
try
:
node_test_suite
=
self
.
node_test_suite_dict
[
reference
]
...
...
@@ -436,4 +436,4 @@ shared = true
# Exceptions are swallowed during cleanup phase
logger
.
info
(
"GENERAL EXCEPTION, QUITING"
)
self
.
cleanUp
()
logger
.
info
(
"GENERAL EXCEPTION, QUITING, cleanup finished"
)
\ No newline at end of file
logger
.
info
(
"GENERAL EXCEPTION, QUITING, cleanup finished"
)
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