Commit 462c4445 authored by Ivan Tyagov's avatar Ivan Tyagov

Delete old paritions which may exists in order to not get its

data (ex. MySQL db content) from previous testnode's runs
parent 294a858c
...@@ -29,6 +29,7 @@ import slapos.slap ...@@ -29,6 +29,7 @@ import slapos.slap
import subprocess import subprocess
import time import time
import xml_marshaller import xml_marshaller
import shutil
MAX_PARTIONS = 10 MAX_PARTIONS = 10
MAX_SR_RETRIES = 3 MAX_SR_RETRIES = 3
...@@ -68,7 +69,10 @@ class SlapOSControler(object): ...@@ -68,7 +69,10 @@ class SlapOSControler(object):
# this is not a problem as usually all services are on different ports # this is not a problem as usually all services are on different ports
partition_reference = '%s-%s' %(config['partition_reference'], i) partition_reference = '%s-%s' %(config['partition_reference'], i)
partition_path = os.path.join(config['instance_root'], partition_reference) partition_path = os.path.join(config['instance_root'], partition_reference)
if not os.path.exists(partition_path): 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.mkdir(partition_path)
os.chmod(partition_path, 0750) os.chmod(partition_path, 0750)
computer.updateConfiguration(xml_marshaller.xml_marshaller.dumps({ computer.updateConfiguration(xml_marshaller.xml_marshaller.dumps({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment