diff options
Diffstat (limited to 'deploy')
-rwxr-xr-x | deploy/check_openstack_progress.sh | 4 | ||||
-rwxr-xr-x | deploy/check_os_progress.sh | 2 | ||||
-rwxr-xr-x | deploy/post.sh | 4 | ||||
-rw-r--r-- | deploy/post/execute.py | 44 |
4 files changed, 41 insertions, 13 deletions
diff --git a/deploy/check_openstack_progress.sh b/deploy/check_openstack_progress.sh index 15dbcdda..7fa16524 100755 --- a/deploy/check_openstack_progress.sh +++ b/deploy/check_openstack_progress.sh @@ -52,6 +52,10 @@ while true; do break elif [ $openstack_install_failed -gt 0 ]; then echo "openstack installing have failed..." + echo "this is the daisy api log" + cat /var/log/daisy/api.log |grep -v wsgi + echo "----------------------------------------------------" + echo "this is the kolla install log" tail -n 200 /var/log/daisy/kolla_$cluster_id* exit 1 else diff --git a/deploy/check_os_progress.sh b/deploy/check_os_progress.sh index e742467c..fe452503 100755 --- a/deploy/check_os_progress.sh +++ b/deploy/check_os_progress.sh @@ -62,6 +62,8 @@ while true; do break elif [ $os_install_failed -gt 0 ]; then echo "os installing have failed..." + echo "this is the daisy api log" + cat /var/log/daisy/api.log |grep -v wsgi exit 1 else progress=`daisy host-list --cluster-id $cluster_id |grep DISCOVERY_SUCCESSFUL |awk -F "|" '{print $7}'|sed s/[[:space:]]//g|sed ':a;N;$ s/\n/ /g;ba'` diff --git a/deploy/post.sh b/deploy/post.sh index e6f39513..3077e007 100755 --- a/deploy/post.sh +++ b/deploy/post.sh @@ -46,6 +46,10 @@ do done python $PYTHONPATH/deploy/post/execute.py -nw $NETWORK +if [ ! $? -eq 0 ]; then + exit 1 +fi + source /etc/kolla/admin-openrc.sh openstack security group rule create --proto icmp default openstack security group rule create --proto tcp --dst-port 22 default diff --git a/deploy/post/execute.py b/deploy/post/execute.py index f64b9af6..94bec65e 100644 --- a/deploy/post/execute.py +++ b/deploy/post/execute.py @@ -14,6 +14,7 @@ import yaml import neutron import nova from deploy.config.network import NetworkConfig +from deploy.utils import err_exit def _config_kolla_admin_openrc(kolla_config_path): @@ -82,21 +83,36 @@ def _create_flavor_m1_micro(): def _prepare_cirros(): - url = 'http://download.cirros-cloud.net' + url = 'https://download.cirros-cloud.net' version = '0.3.5' name = 'cirros-{}-x86_64-disk.img'.format(version) - img = os.path.join("/var/lib/daisy/images", name) + imgpath = "/var/lib/daisy/images" + img = os.path.join(imgpath, name) + imgmd5 = os.path.join(imgpath, "cirros.md5") + if not os.path.isfile(img): - cmd = "wget %(url)s/%(version)s/%(name)s -O %(path)s" % { + cmd = "curl -sSL %(url)s/%(version)s/%(name)s -o %(path)s" % { 'url': url, 'version': version, 'name': name, 'path': img} - try: - print ('Downloading cirros: {}'.format(cmd)) - os.system(cmd) - except Exception as error: - print ('Download cirros failed: {}'.format(str(error))) + print ('Downloading cirros: {}'.format(cmd)) + os.system(cmd) + + cmd = "curl -sSL %(url)s/%(version)s/MD5SUMS -o %(md5path)s" % { + 'url': url, + 'version': version, + 'md5path': imgmd5} + print ('Downloading MD5SUM for cirros: {}'.format(cmd)) + os.system(cmd) + + cmd = "cd %(path)s && cat %(md5path)s | grep %(name)s | md5sum -c" % { + 'path': imgpath, + 'md5path': imgmd5, + 'name': name} + print ('md5sum check cirros: {}'.format(cmd)) + ret = os.system(cmd) + if ret != 0: img = None return img @@ -106,12 +122,14 @@ def _create_image_TestVM(): glanceclient = glance.Glance() image = 'TestVM' if not glanceclient.get_by_name(image): - img = _prepare_cirros() - if img: - try: + try: + img = _prepare_cirros() + if img: glanceclient.create(image, img) - except Exception as error: - print ('Create image failed: {}'.format(str(error))) + else: + err_exit("Test image preparation failed") + except Exception as error: + err_exit('Create image failed: {}'.format(str(error))) else: print ('Use existing TestVM image') |