8000 Merge pull request #653 from tableau/0.12_patch · mhadsouza/server-client-python@43e1b06 · GitHub
[go: up one dir, main page]

Skip to content

Commit 43e1b06

Browse files
author
Chris Shin
authored
Merge pull request tableau#653 from tableau/0.12_patch
0.12 patch to fix login sample
2 parents ebacfe5 + d68244b commit 43e1b06

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.12.1 (22 July 2020)
2+
3+
* Fixed login.py sample to properly handle sitename (#652)
4+
15
## 0.12 (10 July 2020)
26

37
* Added hidden_views parameter to workbook publish method (#614)

samples/login.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def main():
2222
group = parser.add_mutually_exclusive_group(required=True)
2323
group.add_argument('--username', '-u', help='username to sign into the server')
2424
group.add_argument('--token-name', '-n', help='name of the personal access token used to sign into the server')
25-
parser.add_argument('--sitename', '-S', default=None)
25+
parser.add_argument('--sitename', '-S', default='')
2626

2727
args = parser.parse_args()
2828

@@ -36,13 +36,18 @@ def main():
3636
if args.username:
3737
# Trying to authenticate using username and password.
3838
password = getpass.getpass("Password: ")
39-
tableau_auth = TSC.TableauAuth(args.username, password)
39+
40+
print("\nSigning in...\nServer: {}\nSite: {}\nUsername: {}".format(args.server, args.sitename, args.username))
41+
tableau_auth = TSC.TableauAuth(args.username, password, site_id=args.sitename)
4042
with server.auth.sign_in(tableau_auth):
4143
print('Logged in successfully')
4244

4345
else:
4446
# Trying to authenticate using personal access tokens.
45-
personal_access_token = input("Personal Access Token: ")
47+
personal_access_token = getpass.getpass("Personal Access Token: ")
48+
49+
print("\nSigning in...\nServer: {}\nSite: {}\nToken name: {}"
50+
.format(args.server, args.sitename, args.token_name))
4651
tableau_auth = TSC.PersonalAccessTokenAuth(token_name=args.token_name,
4752
personal_access_token=personal_access_token, site_id=args.sitename)
4853
with server.auth.sign_in_with_personal_access_token(tableau_auth):

0 commit comments

Comments
 (0)
0