Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2553)

Unified Diff: boto/ec2/keypair.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « boto/ec2/instance.py ('k') | boto/ec2/securitygroup.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: boto/ec2/keypair.py
diff --git a/boto/ec2/keypair.py b/boto/ec2/keypair.py
index d08e5ce3b4a362ac5d0b3d230a082e860fd5e176..65c95908b0d5cc129c1dac4fcab23b1333a9591b 100644
--- a/boto/ec2/keypair.py
+++ b/boto/ec2/keypair.py
@@ -76,12 +76,14 @@ class KeyPair(EC2Object):
:return: True if successful.
"""
if self.material:
+ directory_path = os.path.expanduser(directory_path)
file_path = os.path.join(directory_path, '%s.pem' % self.name)
if os.path.exists(file_path):
raise BotoClientError('%s already exists, it will not be overwritten' % file_path)
fp = open(file_path, 'wb')
fp.write(self.material)
fp.close()
+ os.chmod(file_path, 0600)
return True
else:
raise BotoClientError('KeyPair contains no material')
« no previous file with comments | « boto/ec2/instance.py ('k') | boto/ec2/securitygroup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698