From 898cd732b3576bd18330d0e8eeaa585b390c27ff Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Wed, 28 Oct 2015 10:34:52 +0900 Subject: [PATCH] openstack: get user-data path relative to the sources The user-data files are in the sources, in the teuthology/openstack directory. By default the template path being used is teuthology/openstack/openstack-{os_type}-{os_version}-user-data.txt and assumes teuthology-suite / teuthology-openstack is run from the root of the source directory. If the user-data path is relative, make it absolute based on the directory in which the openstack module is found. http://tracker.ceph.com/issues/13416 Fixes: #13416 Signed-off-by: Loic Dachary --- teuthology/openstack/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/teuthology/openstack/__init__.py b/teuthology/openstack/__init__.py index 6d8d055ee..fe976a928 100644 --- a/teuthology/openstack/__init__.py +++ b/teuthology/openstack/__init__.py @@ -500,7 +500,12 @@ ssh access : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/ and a few other values are substituted. """ path = tempfile.mktemp() - template = open(self.user_data).read() + if self.user_data.startswith('/'): + user_data = self.user_data + else: + user_data = os.path.join(os.path.dirname(__file__), + '../..', self.user_data) + template = open(user_data).read() openrc = '' for (var, value) in os.environ.iteritems(): if var.startswith('OS_'): -- 2.47.3