From bf577f3908155c9b3b45fe5babf1900aa9123a4b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Sep 2018 09:59:38 -0700 Subject: [PATCH] tests/run: Change required IMAGE_PATH to an optional IMAGE_URL on libvirt Since 9ee45fb6 (*: provide a default OS image for libvirt, 2018-09-17, #271), example/libvirt.yaml has a reasonable default. This commit allows the caller to use it instead of needing their own opinion ;). I've also changed _PATH to _URL to allow the caller to point at other remote images, although this means existing callers will have to update (and add an explicit file:// prefix). --- tests/run.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/run.sh b/tests/run.sh index be0df6c9003..be642e3fd76 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -66,7 +66,6 @@ aws) CONFIGURE_AWS_ROLES=False ;; libvirt) - [ -z ${IMAGE_PATH+x} ] && (echo "Please set libvirt IMAGE_PATH" >&2; exit 1) ;; *) echo "unrecognized backend: ${BACKEND}" >&2 @@ -100,8 +99,8 @@ python <<-EOF >"${CLUSTER_NAME}.yaml" if ${CONFIGURE_AWS_ROLES:-False}: config['aws']['master']['iamRoleName'] = 'tf-tectonic-master-node' config['aws']['worker']['iamRoleName'] = 'tf-tectonic-worker-node' - elif '${BACKEND}' == 'libvirt': - config['libvirt']['image'] = 'file://${IMAGE_PATH}' + elif '${BACKEND}' == 'libvirt' and '${IMAGE_URL}': + config['libvirt']['image'] = '${IMAGE_URL}' yaml.safe_dump(config, sys.stdout) EOF