From 1679d7b5880b6c32514cebab6e888703595e4f6d Mon Sep 17 00:00:00 2001 From: trbs Date: Fri, 4 Mar 2011 16:10:18 +0100 Subject: [PATCH] Added option to reject/disable interactive passwords --- fabric/network.py | 5 +++++ fabric/state.py | 1 + 2 files changed, 6 insertions(+) diff --git a/fabric/network.py b/fabric/network.py index 1876771246..a4d1a332d7 100644 --- a/fabric/network.py +++ b/fabric/network.py @@ -194,6 +194,11 @@ def connect(user, host, port): # Otherwise, assume an auth exception, and prompt for new/better # password. + + # If enviroment specified that no interactive password should be asked + # abort directly with corresponding message. + if env.reject_interactive_password: + abort('Rejecting interactive passwords while trying to connect to %s' % host) # Paramiko doesn't handle prompting for locked private keys (i.e. # keys with a passphrase and not loaded into an agent) so we have diff --git a/fabric/state.py b/fabric/state.py index a59717d5c6..be893d1115 100644 --- a/fabric/state.py +++ b/fabric/state.py @@ -244,6 +244,7 @@ def _rc_path(): 'sudo_prompt': 'sudo password:', 'use_shell': True, 'user': None, + 'reject_interactive_password': False, 'version': get_version('short') })