Migrate to fileutils and lockutils.

Migrate nova to using openstack-common's file and lock utilities.
Resolves bug 1063230.

Change-Id: I1a4c87856bc08cd33b61d7098ed856baa4583654
This commit is contained in:
Michael Still
2012-10-23 14:25:25 -07:00
parent 86b91474d1
commit 0d4e6dbe6f
28 changed files with 364 additions and 395 deletions

View File

@@ -33,6 +33,7 @@ from nova import db
from nova import exception
from nova import flags
from nova.openstack.common import cfg
from nova.openstack.common import fileutils
from nova.openstack.common import log as logging
from nova import utils
@@ -150,7 +151,7 @@ class CloudPipe(object):
key_name)
private_key = result['private_key']
key_dir = os.path.join(FLAGS.keys_path, context.user_id)
utils.ensure_tree(key_dir)
fileutils.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)