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
Yusei Tahara
erp5
Commits
1c827f20
Commit
1c827f20
authored
Jan 11, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: Use tempfile to generate a random socket path for slapos supervisord
parent
e962b187
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+9
-0
erp5/util/testnode/template/slapos.cfg.in
erp5/util/testnode/template/slapos.cfg.in
+2
-0
No files found.
erp5/util/testnode/SlapOSControler.py
View file @
1c827f20
...
...
@@ -35,6 +35,7 @@ import sys
import
glob
import
argparse
import
json
import
tempfile
from
slapos
import
client
MAX_PARTIONS
=
10
...
...
@@ -256,8 +257,16 @@ class SlapOSControler(object):
self
.
log
(
'SlapOSControler, initialize, reset_software: %r'
%
reset_software
)
config
=
self
.
config
slapos_config_dict
=
self
.
config
.
copy
()
supervisord_socket
=
os
.
path
.
join
(
self
.
instance_root
,
'supervisord.socket'
)
if
len
(
supervisord_socket
)
>=
80
:
# We want to avoid AF_UNIX path too long error.
supervisord_socket
=
'%s-supervisord.socket'
%
tempfile
.
mktemp
()
self
.
log
(
'Using shorter supervisord_socket %s'
%
supervisord_socket
)
slapos_config_dict
.
update
(
software_root
=
self
.
software_root
,
instance_root
=
self
.
instance_root
,
supervisord_socket
=
supervisord_socket
,
proxy_database
=
self
.
proxy_database
)
open
(
self
.
slapos_config
,
'w'
).
write
(
pkg_resources
.
resource_string
(
'erp5.util.testnode'
,
'template/slapos.cfg.in'
)
%
...
...
erp5/util/testnode/template/slapos.cfg.in
View file @
1c827f20
...
...
@@ -4,8 +4,10 @@ instance_root = %(instance_root)s
master_url = %(master_url)s
computer_id = %(computer_id)s
root_check = False
supervisord_socket = %(supervisord_socket)s
[slapproxy]
host = %(proxy_host)s
port = %(proxy_port)s
database_uri = %(proxy_database)s
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