Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #18 from punchagan/verify-userpass

ENH: Verify userpass details before saving them.
  • Loading branch information...
commit f3ba15dd2f952ccaeecd85b7c22d18fc5b3b4e66 2 parents 8ed862e + 0ab6aaa
@jdmarch jdmarch authored
Showing with 17 additions and 5 deletions.
  1. +17 −5 enstaller/main.py
View
22 enstaller/main.py
@@ -313,11 +313,6 @@ def main():
config.print_config()
return
- if args.userpass: # --userpass
- username, password = config.input_auth()
- config.change_auth(username, password)
- return
-
if args.list: # --list
list_option(prefixes, args.hook, pat)
return
@@ -345,6 +340,23 @@ def main():
enpkg = Enpkg(remote, prefixes=prefixes, hook=args.hook,
evt_mgr=evt_mgr, verbose=args.verbose)
+
+ if args.userpass: # --userpass
+ auth = username, password = config.input_auth()
+ if remote is not None:
+ try:
+ print 'Verifying username and password...'
+ remote.connect(auth)
+ except KeyError as e:
+ print 'Invalid Username or Password'
+ except Exception as e:
+ print e.message
+ else:
+ config.change_auth(username, password)
+ else:
+ config.change_auth(username, password)
+ return
+
if args.dry_run:
def print_actions(actions):
for item in actions:
Please sign in to comment.
Something went wrong with that request. Please try again.