diff options
Diffstat (limited to 'fuel')
-rwxr-xr-x | fuel/ci/deploy.sh | 17 | ||||
-rw-r--r-- | fuel/deploy/README.txt | 34 | ||||
-rw-r--r-- | fuel/deploy/deploy.py | 14 | ||||
-rw-r--r-- | fuel/deploy/deploy_env.py | 6 | ||||
-rw-r--r-- | fuel/deploy/install_fuel_master.py | 2 | ||||
-rw-r--r-- | fuel/deploy/ssh_client.py | 1 |
6 files changed, 37 insertions, 37 deletions
diff --git a/fuel/ci/deploy.sh b/fuel/ci/deploy.sh index df23249..5923f5c 100755 --- a/fuel/ci/deploy.sh +++ b/fuel/ci/deploy.sh @@ -1,12 +1,9 @@ -#!/bin/bash -x -set -o xtrace -set -o errexit -set -o nounset -set -o pipefail +#!/bin/bash +topdir=$(dirname $(readlink -f $BASH_SOURCE)) +deploydir=$(cd ${topdir}/../deploy; pwd) -WORKSPACE=$(readlink -e ..) -ISO_LOCATION="$(readlink -f $(find $WORKSPACE -iname 'fuel*iso' -type f))" -INTERFACE="fuel" +pushd ${deploydir} > /dev/null +echo -e "python deploy.py $@\n" +python deploy.py $@ +popd > /dev/null -cd "${WORKSPACE}/deploy" -./deploy_fuel.sh "$ISO_LOCATION" $INTERFACE 2>&1 | tee deploy_fuel.log diff --git a/fuel/deploy/README.txt b/fuel/deploy/README.txt index 6f322d0..33baff1 100644 --- a/fuel/deploy/README.txt +++ b/fuel/deploy/README.txt @@ -55,32 +55,32 @@ you will have to modify them according to your needs --- Step.2 Run Autodeployment: -usage: python deploy.py [-h] [-nf] - [iso_file] dea_file dha_file [storage_dir] - [pxe_bridge] +usage: python deploy.py [-h] [-nf] [-s [STORAGE_DIR]] [-b [PXE_BRIDGE]] + [iso_file] dea_file dha_file positional arguments: - iso_file ISO File [default: OPNFV.iso] - dea_file Deployment Environment Adapter: dea.yaml - dha_file Deployment Hardware Adapter: dha.yaml - storage_dir Storage Directory [default: images] - pxe_bridge Linux Bridge for booting up the Fuel Master VM [default: pxebr] + iso_file ISO File [default: OPNFV.iso] + dea_file Deployment Environment Adapter: dea.yaml + dha_file Deployment Hardware Adapter: dha.yaml optional arguments: - -h, --help show this help message and exit - -nf Do not install Fuel Master (and Node VMs when using libvirt) + -h, --help show this help message and exit + -nf Do not install Fuel Master (and Node VMs when using + libvirt) + -s [STORAGE_DIR] Storage Directory [default: images] + -b [PXE_BRIDGE] Linux Bridge for booting up the Fuel Master VM [default: + pxebr] * WARNING: -If <storage_dir> is not specified, Autodeployment will use -"<current_working_dir>/images" as default, and it will create it, -if it hasn't been created before +If optional argument -s <storage_dir> is not specified, Autodeployment will use +"<current_working_dir>/images" as default, and it will create it, if it hasn't been created before -If <pxe_bridge> is not specified, Autodeployment will use "pxebr" as default, +If optional argument -b <pxe_bridge> is not specified, Autodeployment will use "pxebr" as default, if the bridge does not exist, the application will terminate with an error message -IF <storage_dir> is not specified, Autodeployment will use "<current_working_dir>/OPNFV.iso" +IF optional argument <iso_file> is not specified, Autodeployment will use "<current_working_dir>/OPNFV.iso" as default, if the iso file does not exist, the application will terminate with an error message <pxe_bridge> is not required for Autodeployment in virtual environment, even if it is specified @@ -91,12 +91,12 @@ it will not be used at all - Install Fuel Master and deploy OPNFV Cloud from scratch on Baremetal Environment -sudo python deploy.py ~/ISO/opnfv.iso ~/CONF/baremetal/dea.yaml ~/CONF/baremetal/dha.yaml /mnt/images pxebr +sudo python deploy.py ~/ISO/opnfv.iso ~/CONF/baremetal/dea.yaml ~/CONF/baremetal/dha.yaml -s /mnt/images -b pxebr - Install Fuel Master and deploy OPNFV Cloud from scratch on Virtual Environment -sudo python deploy.py ~/ISO/opnfv.iso ~/CONF/virtual/dea.yaml ~/CONF/virtual/dha.yaml /mnt/images +sudo python deploy.py ~/ISO/opnfv.iso ~/CONF/virtual/dea.yaml ~/CONF/virtual/dha.yaml -s /mnt/images diff --git a/fuel/deploy/deploy.py b/fuel/deploy/deploy.py index 3305aed..33c6f9f 100644 --- a/fuel/deploy/deploy.py +++ b/fuel/deploy/deploy.py @@ -2,6 +2,7 @@ import os import shutil import io import re +import sys import netaddr import uuid import yaml @@ -138,7 +139,7 @@ class AutoDeploy(object): def deploy_env(self): dep = CloudDeploy(self.dha, self.fuel_conf['ip'], self.fuel_username, self.fuel_password, self.dea_file, WORK_DIR) - dep.deploy() + return dep.deploy() def setup_execution_environment(self): exec_env = ExecutionEnvironment(self.storage_dir, self.pxe_bridge, @@ -157,7 +158,7 @@ class AutoDeploy(object): self.create_tmp_dir() self.install_fuel_master() shutil.rmtree(self.tmp_dir) - self.deploy_env() + return self.deploy_env() def check_bridge(pxe_bridge, dha_path): with io.open(dha_path) as yaml_file: @@ -183,15 +184,16 @@ def parse_arguments(): help='Deployment Environment Adapter: dea.yaml') parser.add_argument('dha_file', action='store', help='Deployment Hardware Adapter: dha.yaml') - parser.add_argument('storage_dir', nargs='?', action='store', + parser.add_argument('-s', dest='storage_dir', action='store', default='%s/images' % CWD, help='Storage Directory [default: images]') - parser.add_argument('pxe_bridge', nargs='?', action='store', + parser.add_argument('-b', dest='pxe_bridge', action='store', default='pxebr', help='Linux Bridge for booting up the Fuel Master VM ' '[default: pxebr]') args = parser.parse_args() + log(args) check_file_exists(args.dea_file) check_file_exists(args.dha_file) @@ -201,8 +203,6 @@ def parse_arguments(): check_file_exists(args.iso_file) log('Using image directory: %s' % args.storage_dir) create_dir_if_not_exists(args.storage_dir) - log('Using bridge %s to boot up Fuel Master VM on it' - % args.pxe_bridge) check_bridge(args.pxe_bridge, args.dha_file) return (args.without_fuel, args.storage_dir, args.pxe_bridge, @@ -215,7 +215,7 @@ def main(): d = AutoDeploy(without_fuel, storage_dir, pxe_bridge, iso_file, dea_file, dha_file) - d.deploy() + sys.exit(d.deploy()) if __name__ == '__main__': main()
\ No newline at end of file diff --git a/fuel/deploy/deploy_env.py b/fuel/deploy/deploy_env.py index 48aec18..084f37e 100644 --- a/fuel/deploy/deploy_env.py +++ b/fuel/deploy/deploy_env.py @@ -68,7 +68,9 @@ class CloudDeploy(object): dea_file = '%s/%s' % (self.work_dir, os.path.basename(self.dea_file)) macs_file = '%s/%s' % (self.work_dir, os.path.basename(self.macs_file)) with self.ssh as s: - s.run('python %s %s %s' % (deploy_app, dea_file, macs_file)) + status = s.run('python %s %s %s' + % (deploy_app, dea_file, macs_file)) + return status def deploy(self): @@ -84,4 +86,4 @@ class CloudDeploy(object): self.upload_cloud_deployment_files() - self.run_cloud_deploy(CLOUD_DEPLOY_FILE) + return self.run_cloud_deploy(CLOUD_DEPLOY_FILE) diff --git a/fuel/deploy/install_fuel_master.py b/fuel/deploy/install_fuel_master.py index ea24ff0..b9b7809 100644 --- a/fuel/deploy/install_fuel_master.py +++ b/fuel/deploy/install_fuel_master.py @@ -138,7 +138,7 @@ class InstallFuelMaster(object): self.work_dir, os.path.basename(self.dea_file))) def wait_until_installation_completed(self): - WAIT_LOOP = 320 + WAIT_LOOP = 360 SLEEP_TIME = 10 CMD = 'ps -ef | grep %s | grep -v grep' % BOOTSTRAP_ADMIN diff --git a/fuel/deploy/ssh_client.py b/fuel/deploy/ssh_client.py index 8bf87bc..0ec2edc 100644 --- a/fuel/deploy/ssh_client.py +++ b/fuel/deploy/ssh_client.py @@ -70,6 +70,7 @@ class SSHClient(object): while error_buff: log(error_buff.strip()) error_buff = chan.recv_stderr(1024) + return chan.recv_exit_status() def scp_get(self, remote, local='.', dir=False): try: |