Commit cc7b41e7 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[master] Merge branch 'trac680'

parents ccf170ee ac0eaa43
...@@ -208,12 +208,13 @@ WARNING: Python readline module isn't available, so the command line editor ...@@ -208,12 +208,13 @@ WARNING: Python readline module isn't available, so the command line editor
return True return True
def login_to_cmdctl(self): def login_to_cmdctl(self):
'''Login to cmdctl with the username and password inputted '''Login to cmdctl with the username and password given by
from user. After the login is sucessful, the username and the user. After the login is sucessful, the username and
password will be saved in 'default_user.csv', when run the next password will be saved in 'default_user.csv', when run the next
time, username and password saved in 'default_user.csv' will be time, username and password saved in 'default_user.csv' will be
used first. used first.
''' '''
# Look at existing username/password combinations and try to log in
users = self._get_saved_user_info(self.csv_file_dir, CSV_FILE_NAME) users = self._get_saved_user_info(self.csv_file_dir, CSV_FILE_NAME)
for row in users: for row in users:
param = {'username': row[0], 'password' : row[1]} param = {'username': row[0], 'password' : row[1]}
...@@ -230,15 +231,18 @@ WARNING: Python readline module isn't available, so the command line editor ...@@ -230,15 +231,18 @@ WARNING: Python readline module isn't available, so the command line editor
print(data + ' login as ' + row[0]) print(data + ' login as ' + row[0])
return True return True
# No valid logins were found, prompt the user for a username/password
count = 0 count = 0
print("[TEMP MESSAGE]: username :root password :bind10") print('No stored password file found, please see sections '
'"Configuration specification for b10-cmdctl" and "bindctl '
'command-line options" of the BIND 10 guide.')
while True: while True:
count = count + 1 count = count + 1
if count > 3: if count > 3:
print("Too many authentication failures") print("Too many authentication failures")
return False return False
username = input("Username:") username = input("Username: ")
passwd = getpass.getpass() passwd = getpass.getpass()
param = {'username': username, 'password' : passwd} param = {'username': username, 'password' : passwd}
try: try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment