diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2010-06-24 20:59:16 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2010-06-24 20:59:16 -0700 |
| commit | 6d8d59180088ec8855e088a217b58b741f34aac4 (patch) | |
| tree | 763bf816d69a9ab9edde2d668bfdfce2838f5933 /nova/cloudpipe | |
| parent | 8a2f1763cbadd47f6ce26467ac9f82bc9b436d2a (diff) | |
| download | nova-6d8d59180088ec8855e088a217b58b741f34aac4.tar.gz nova-6d8d59180088ec8855e088a217b58b741f34aac4.tar.xz nova-6d8d59180088ec8855e088a217b58b741f34aac4.zip | |
don't fail to create vpn key if dir exists
Diffstat (limited to 'nova/cloudpipe')
| -rw-r--r-- | nova/cloudpipe/pipelib.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py index 09da71c64..cec3e5dca 100644 --- a/nova/cloudpipe/pipelib.py +++ b/nova/cloudpipe/pipelib.py @@ -81,7 +81,8 @@ class CloudPipe(object): private_key, fingerprint = self.manager.generate_key_pair(user_id, key_name) try: key_dir = os.path.join(FLAGS.keys_path, user_id) - os.makedirs(key_dir) + if not os.path.exists(key_dir): + os.makedirs(key_dir) with open(os.path.join(key_dir, '%s.pem' % key_name),'w') as f: f.write(private_key) except: |
