Skip to content

Commit

Permalink
make reset password work
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Jun 15, 2023
1 parent 33d724b commit 6c7bac1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pygeoweaver/sc_resetpassword.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import getpass
from logging import getLogger
import subprocess
from pygeoweaver.utils import (
check_ipython,
Expand All @@ -7,10 +9,12 @@
get_root_dir,
)

logger = getLogger(__name__)

def get_password_twice():
while True:
password1 = getpass('Enter password: ')
password2 = getpass('Re-enter password: ')
password1 = getpass.getpass('Enter password: ')
password2 = getpass.getpass('Re-enter password: ')

if password1 == password2:
return password1
Expand All @@ -26,6 +30,7 @@ def reset_password():
download_geoweaver_jar()

if check_ipython():
logger.debug("ipython is here")
password = get_password_twice()
subprocess.run(
[
Expand All @@ -38,6 +43,7 @@ def reset_password():
]
)
else:
logger.debug("not ipython")
subprocess.run(
[
get_java_bin_path(),
Expand Down

0 comments on commit 6c7bac1

Please sign in to comment.