summaryrefslogtreecommitdiffstats
path: root/nova/cloudpipe
diff options
context:
space:
mode:
authorMichael Still <mikal@stillhq.com>2012-08-27 13:17:36 +1000
committerMichael Still <mikal@stillhq.com>2012-08-28 07:58:18 +1000
commita73334b47a88e6b1c0f33db5312edd49d50c097b (patch)
tree5fe9e546cf787e7017891de393feb314291da027 /nova/cloudpipe
parent0d1e9ef251ce91d72d9671c5b4c8c02c87205d3a (diff)
downloadnova-a73334b47a88e6b1c0f33db5312edd49d50c097b.tar.gz
nova-a73334b47a88e6b1c0f33db5312edd49d50c097b.tar.xz
nova-a73334b47a88e6b1c0f33db5312edd49d50c097b.zip
Port existing code to utils.ensure_tree
Now that we have ensure_tree in utils, port most users of os.makedirs() to use it. Change-Id: I3256cbb76bd889f99f1e6f3367bd620645f828a1
Diffstat (limited to 'nova/cloudpipe')
-rw-r--r--nova/cloudpipe/pipelib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py
index 6a772eb63..4e498e2c9 100644
--- a/nova/cloudpipe/pipelib.py
+++ b/nova/cloudpipe/pipelib.py
@@ -150,8 +150,7 @@ class CloudPipe(object):
key_name)
private_key = result['private_key']
key_dir = os.path.join(FLAGS.keys_path, context.user_id)
- if not os.path.exists(key_dir):
- os.makedirs(key_dir)
+ utils.ensure_tree(key_dir)
key_path = os.path.join(key_dir, '%s.pem' % key_name)
with open(key_path, 'w') as f:
f.write(private_key)