Soften guard for ceph loop device in ci script so we can move it

As part of [1] we want to drop tripleo.sh --bootstrap-subnodes
from the ci scripts and move to ansible. For zuul v3 jobs we do
that in [2].

For "legacy" and rdo jobs the equivalent change is spread at [3]
and [4]. We can't merge [3] however because it would create the
loop device and so cause the exit being removed in this review
to fail the jobs

Thus we need to soften this guard here and log a warning. Once
this merges first, we can then merge [3] and then [4]

[1] https://trello.com/c/lrSUMaqw/885-translate-tripleosh-bootstrap-subnodes-into-a-series-of-tasks-s17
[2] https://review.openstack.org/#/c/583195/
[3] https://review.rdoproject.org/r/#/c/15000/
[4] https://review.openstack.org/#/c/587012/

Change-Id: Id69c3148bd077e338ef29b9bf8edc57fa2581699
This commit is contained in:
Marios Andreou 2018-07-31 12:43:31 +03:00
parent c74217930b
commit 5b55fbbd57
1 changed files with 3 additions and 1 deletions

View File

@ -46,8 +46,10 @@ if [[ "${TOCI_JOBTYPE:-''}" =~ multinode ]]; then
command -v losetup >/dev/null 2>&1 || { sudo yum -y install util-linux; }
sudo dd if=/dev/zero of=/var/lib/ceph-osd.img bs=1 count=0 seek=7G
sudo losetup /dev/loop3 /var/lib/ceph-osd.img
elif [[ -f /var/lib/ceph-osd.img ]]; then #loop3 and ceph-osd.img exist
echo "warning: looks like ceph loop device already created. Trying to continue"
else
echo "ERROR: /dev/loop3 already exists, not using it with losetup"
echo "error: /dev/loop3 exists but not /var/lib/ceph-osd.img. Exiting."
exit 1
fi
sudo lsblk