]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
buildpackages: desambiguate nic on server create
authorLoic Dachary <ldachary@redhat.com>
Mon, 28 Mar 2016 17:44:54 +0000 (19:44 +0200)
committerLoic Dachary <ldachary@redhat.com>
Mon, 28 Mar 2016 17:52:00 +0000 (19:52 +0200)
When there are more than one network, it is required to select the one
to be attached to the nic of the instance.

Signed-off-by: Loic Dachary <loic@dachary.org>
tasks/buildpackages.py
tasks/buildpackages/Makefile

index cd8e2084e32781116115dc9925cb9a6f29191154..ecf853432bbfd3fb9540c6d3af71550ae83db19a 100644 (file)
@@ -185,6 +185,9 @@ def task(ctx, config):
             select = '^(vps|eg)-'
         else:
             select = ''
+        network = openstack.net()
+        if network != "":
+            network = " OPENSTACK_NETWORK='" + network + "' "
         openstack.image(os_type, os_version, arch) # create if it does not exist
         build_flavor = openstack.flavor_range(
             config['min_machine'], config['good_machine'], arch, select)
@@ -198,6 +201,7 @@ def task(ctx, config):
         cmd = (". " + os.environ['HOME'] + "/.ssh_agent ; " +
                " flock --close " + lock +
                " make -C " + d +
+               network +
                " CEPH_GIT_URL=" + teuth_config.get_ceph_git_url() +
                " CEPH_PKG_TYPE=" + pkg_type +
                " CEPH_OS_TYPE=" + os_type +
index fb79bcbbc43d79fa0d0b0b9cd7a302860a336fdd..0dcc29ca58168e87a477a78e98ac6cc147d6e3e2 100644 (file)
@@ -30,7 +30,7 @@ ${HOME}/.ssh_agent:
        grep -q ssh_agent ~/.bashrc_teuthology || echo 'source ${HOME}/.ssh_agent' >> ~/.bashrc_teuthology
 
 flock-${PKG_REPO}:
-       openstack server create --image 'teuthology-ubuntu-14.04-${HTTP_ARCH}' --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${PKG_REPO_USER_DATA} --wait ${PKG_REPO}
+       openstack server create --image 'teuthology-ubuntu-14.04-${HTTP_ARCH}' ${OPENSTACK_NETWORK} --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${PKG_REPO_USER_DATA} --wait ${PKG_REPO}
        sleep 30
        set -ex ; \
        ip=$(call get_ip,${PKG_REPO}) ; \
@@ -50,7 +50,7 @@ ${PKG_REPO}:
        touch ${D}/$@
 
 ceph-${CEPH_PKG_TYPE}-${CEPH_DIST}-${CEPH_ARCH}-${CEPH_FLAVOR}-${CEPH_SHA1}: ${PKG_REPO}
-       openstack server create --image 'teuthology-${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-${CEPH_ARCH}' --flavor ${BUILD_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-user-data.txt --wait $@
+       openstack server create --image 'teuthology-${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-${CEPH_ARCH}' ${OPENSTACK_NETWORK} --flavor ${BUILD_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-user-data.txt --wait $@
        sleep 30
        set -ex ; \
        trap "openstack server delete --wait $@" EXIT ; \