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
Laurent S
erp5
Commits
5df3c416
Commit
5df3c416
authored
Apr 24, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete all partitions, including ones not following current naming scheme.
Fixes upgrade path from older erp5testnode version.
parent
a141a2f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+7
-4
erp5/util/testnode/__init__.py
erp5/util/testnode/__init__.py
+2
-3
No files found.
erp5/util/testnode/SlapOSControler.py
View file @
5df3c416
...
...
@@ -74,16 +74,19 @@ class SlapOSControler(object):
os
.
mkdir
(
software_root
)
os
.
chmod
(
software_root
,
0750
)
instance_root
=
config
[
'instance_root'
]
if
os
.
path
.
exists
(
instance_root
):
# delete old paritions which may exists in order to not get its data
# (ex. MySQL db content) from previous testnode's runs
# In order to be able to change partition naming scheme, do this at
# instance_root level (such change happened already, causing problems).
shutil
.
rmtree
(
instance_root
)
os
.
mkdir
(
instance_root
)
for
i
in
range
(
0
,
MAX_PARTIONS
):
# create partition and configure computer
# XXX: at the moment all partitions do share same virtual interface address
# this is not a problem as usually all services are on different ports
partition_reference
=
'%s-%s'
%
(
config
[
'partition_reference'
],
i
)
partition_path
=
os
.
path
.
join
(
instance_root
,
partition_reference
)
if
os
.
path
.
exists
(
partition_path
):
# delete old paritions which may exists in order to not get its data (ex. MySQL db content)
# from previous testnode's runs
shutil
.
rmtree
(
partition_path
)
os
.
mkdir
(
partition_path
)
os
.
chmod
(
partition_path
,
0750
)
computer
.
updateConfiguration
(
xml_marshaller
.
xml_marshaller
.
dumps
({
...
...
erp5/util/testnode/__init__.py
View file @
5df3c416
...
...
@@ -90,9 +90,8 @@ def main(*args):
CONFIG
[
'proxy_database'
]
=
os
.
path
.
join
(
slapos_directory
,
'proxy.db'
)
CONFIG
[
'slapos_config'
]
=
slapos_config
=
os
.
path
.
join
(
slapos_directory
,
'slapos.cfg'
)
for
d
in
software_root
,
instance_root
:
if
not
os
.
path
.
lexists
(
d
):
os
.
mkdir
(
d
)
if
not
os
.
path
.
lexists
(
software_root
):
os
.
mkdir
(
software_root
)
CONFIG
[
'master_url'
]
=
'http://%s:%s'
%
(
CONFIG
[
'proxy_host'
],
CONFIG
[
'proxy_port'
])
open
(
slapos_config
,
'w'
).
write
(
pkg_resources
.
resource_string
(
...
...
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