Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

just use the last token #8

Merged
merged 1 commit into from Aug 22, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

just use the last token

  • Loading branch information
Mike Blume
Mike Blume committed Aug 22, 2013
commit b99bb9ff298d5eb70c4faf51bc1e305422e848f9
@@ -787,36 +787,8 @@ def get_auth_token(loggly_user, loggly_password, loggly_subdomain):
auth_tokens = get_auth(loggly_user,
loggly_password,
loggly_subdomain)

user_choice = 0
num_tokens = len(auth_tokens)
if num_tokens > 1:
Logger.printLog(("Multiple Customer Tokens"
" received from server."),
print_comp = True)
for i, token in enumerate(auth_tokens):
Logger.printLog("\t%d. %s"%(i + 1, token),
print_comp = True)
for _ in range(5):
try:
str_msg = ("Please select (1-" + str(num_tokens) + ")"
"to specify which Customer Token "
"you want to use. (Default is 1): ")
user_choice = int(usr_input(str_msg)) - 1
if user_choice < 0 or user_choice >= num_tokens:
Logger.printLog("Invalid choice entered.",
prio = 'error', print_comp = True)
continue
break
except ValueError:
Logger.printLog("Not a valid selection. Please retry.",
prio = 'warning', print_comp = True)
if user_choice < 0 or user_choice >= num_tokens:
Logger.printLog(("Invalid choice entered. "
"Continue with default value."),
prio = 'warning', print_comp = True)
user_choice = 0
token = auth_tokens[user_choice]
# use the last token returned
token = auth_tokens[-1]
Logger.printLog(('\nThis system is now configured to use '
'\"%s\" as its Customer Token.\n' % token),
print_comp = True)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.