Skip to content

Commit

Permalink
If no tty check for missing and incorrect passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Jul 3, 2018
1 parent 86bf287 commit 7dd2d3b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/tools/OmeroPy/src/omero/plugins/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,13 @@ def login(self, args):
if not pasw:
pasw = os.getenv("OMERO_PASSWORD")

if not pasw:
# Note: duplicating the `not pasw` check here
# for an overall nicer error message.
self._require_tty("cannot request password")

tries = 3
while True:
try:
if not pasw:
# Handle absent and incorrect passwords in
# non-interactive mode
self._require_tty("cannot request password")
if args.sudo:
prompt = "Password for %s:" % args.sudo
else:
Expand Down

0 comments on commit 7dd2d3b

Please sign in to comment.