Created
January 25, 2011 08:53
-
-
Save cocoy/794683 to your computer and use it in GitHub Desktop.
patch to ssh keypair for littlechef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/littlechef.py | |
+++ b/littlechef.py | |
@@ -49,6 +49,7 @@ def new_deployment(): | |
print >>authfh, "[userinfo]" | |
print >>authfh, "user = " | |
print >>authfh, "password = " | |
+ print >>authfh, "keypair-file = " | |
print "auth.cfg file created..." | |
@hosts('setup') | |
@@ -219,9 +220,14 @@ def _readconfig(): | |
raise ValueError | |
except (ConfigParser.NoOptionError, ValueError): | |
abort('You need to define a valid user in auth.cfg') | |
+ | |
env.password = config.get('userinfo', 'password') | |
- except ConfigParser.NoSectionError: | |
- msg = 'You need to define a user and password in the "userinfo" section' | |
+ env.key_filename = config.get('userinfo','keypair-file') | |
+ if not env.password and not env.key_filename: | |
+ raise ValueError | |
+ except (ConfigParser.NoSectionError, ValueError): | |
+ | |
+ msg = 'You need to define a user and password or path-to-keypair in the "userinfo" section' | |
msg += ' of auth.cfg. Refer to the README for help' | |
msg += ' (http://github.com/tobami/littlechef)' | |
abort(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment