summaryrefslogtreecommitdiffstats
path: root/deploy/daisy_server.py
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-07-29 20:29:52 +0800
committerAlex Yang <yangyang1@zte.com.cn>2017-07-31 15:35:11 +0800
commitb35baf61e48a1d2aff88e7c3e100aa996422d849 (patch)
treeded0fe80802a336d1729f607baadac9a90e3b5e5 /deploy/daisy_server.py
parente47fc2d62d07633c1883253d42f8e2cade35e868 (diff)
Correct the mapping of nodes and roles in virtual deploy
JIRA: DAISY-56 Now the roles are assigned to nodes randomly, because the function 'add_hosts_interface' in tempest.py just uses zip to map the host's name to the host. libvirt_utils.py: get mac addresses from VM environment.py: save the mac addresses daisy_server.py: write a new deploy.yml which contains the mac addresses and copy the file to daisy server get_conf.py: get mac addresses from the new deploy.yml tempest.py: assigned roles to nodes when the mac addresses matched controller.xml: increase the RAM to make difference with computer nodes deploy.sh: apply this change to bash script Change-Id: Ia61b60d39d319c5d01e3505727fafc63a0585858 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'deploy/daisy_server.py')
-rw-r--r--deploy/daisy_server.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/deploy/daisy_server.py b/deploy/daisy_server.py
index eb711afd..a899ea2b 100644
--- a/deploy/daisy_server.py
+++ b/deploy/daisy_server.py
@@ -10,7 +10,9 @@
import os
import paramiko
import scp
+import tempfile
import time
+import yaml
from utils import (
WORKSPACE,
@@ -230,6 +232,13 @@ class DaisyServer(object):
net_file=path_join(self.remote_dir, self.net_file_name))
self.ssh_run(cmd, check=True)
+ def copy_new_deploy_config(self, data):
+ (dummy, conf_file) = tempfile.mkstemp()
+ with open(conf_file, 'w') as fh:
+ fh.write(yaml.safe_dump(data))
+ fh.flush()
+ self.scp_put(conf_file, path_join(self.remote_dir, self.deploy_file_name))
+
def prepare_host_and_pxe(self):
LI('Prepare host and PXE')
cmd = "python {script} --dha {deploy_file} --network {net_file} --host \'yes\' --isbare {is_bare} --scenario {scenario}".format(