From 7cfa625a31c2bba1e890c26a205b36aba3df6f32 Mon Sep 17 00:00:00 2001 From: Pete Travis Date: Sat, 13 Feb 2016 20:22:13 -0600 Subject: [PATCH] use expanduser() before testing user_data as file I like to use ~/somepath instead of absolute paths because that's more shareable. Without expansion, the path wasn't considered a file, and the resulting cloud-config user_data contained a string for the file path instead of the file context. So, expand it. --- cloud/rackspace/rax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/rackspace/rax.py b/cloud/rackspace/rax.py index dad2e2a4f8d..a859e7a7bb3 100644 --- a/cloud/rackspace/rax.py +++ b/cloud/rackspace/rax.py @@ -285,7 +285,7 @@ def create(module, names=[], flavor=None, image=None, meta={}, key_name=None, if user_data: config_drive = True - if user_data and os.path.isfile(user_data): + if user_data and os.path.isfile(os.path.expanduser('user_data')): try: f = open(user_data) user_data = f.read()