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
This commit is contained in:
Michael Still
2012-08-27 13:17:36 +10:00
parent 0d1e9ef251
commit a73334b47a
7 changed files with 26 additions and 39 deletions

View File

@@ -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)