From 0da852e8abd24d279c37ddd225c0044658db7930 Mon Sep 17 00:00:00 2001 From: Chris Shin Date: Tue, 21 Jul 2020 10:16:01 -0700 Subject: [PATCH 1/3] Fixes login sample to pass in sitename for username/password auth (cherry picked from commit 4cbd8007f64dbc93e1bf89981f5cfbcec01f83bb) --- samples/login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/login.py b/samples/login.py index 57a929f6b..339a711cb 100644 --- a/samples/login.py +++ b/samples/login.py @@ -36,7 +36,7 @@ def main(): if args.username: # Trying to authenticate using username and password. password = getpass.getpass("Password: ") - tableau_auth = TSC.TableauAuth(args.username, password) + tableau_auth = TSC.TableauAuth(args.username, password, site_id=args.sitename) with server.auth.sign_in(tableau_auth): print('Logged in successfully') From 3041b4aecaf5dac3a4af3cb8797f114f3063fa5b Mon Sep 17 00:00:00 2001 From: Chris Shin Date: Wed, 22 Jul 2020 14:09:10 -0700 Subject: [PATCH 2/3] Fixes default sitename in login sample and adds more print statements (#652) (cherry picked from commit ccbbc49b5278d6c4605262612cb18ebd265aea0a) --- samples/login.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/samples/login.py b/samples/login.py index 339a711cb..29e02e14e 100644 --- a/samples/login.py +++ b/samples/login.py @@ -22,7 +22,7 @@ def main(): group = parser.add_mutually_exclusive_group(required=True) group.add_argument('--username', '-u', help='username to sign into the server') group.add_argument('--token-name', '-n', help='name of the personal access token used to sign into the server') - parser.add_argument('--sitename', '-S', default=None) + parser.add_argument('--sitename', '-S', default='') args = parser.parse_args() @@ -36,13 +36,18 @@ def main(): if args.username: # Trying to authenticate using username and password. password = getpass.getpass("Password: ") + + print("\nSigning in...\nServer: {}\nSite: {}\nUsername: {}".format(args.server, args.sitename, args.username)) tableau_auth = TSC.TableauAuth(args.username, password, site_id=args.sitename) with server.auth.sign_in(tableau_auth): print('Logged in successfully') else: # Trying to authenticate using personal access tokens. - personal_access_token = input("Personal Access Token: ") + personal_access_token = getpass.getpass("Personal Access Token: ") + + print("\nSigning in...\nServer: {}\nSite: {}\nToken name: {}" + .format(args.server, args.sitename, args.token_name)) tableau_auth = TSC.PersonalAccessTokenAuth(token_name=args.token_name, personal_access_token=personal_access_token, site_id=args.sitename) with server.auth.sign_in_with_personal_access_token(tableau_auth): From d68244b0a43a97f7f36841d573e3354b46ebd99f Mon Sep 17 00:00:00 2001 From: Chris Shin Date: Wed, 22 Jul 2020 15:23:10 -0700 Subject: [PATCH 3/3] Updates changelog with patch notes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa01dac19..d0da3f294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.12.1 (22 July 2020) + +* Fixed login.py sample to properly handle sitename (#652) + ## 0.12 (10 July 2020) * Added hidden_views parameter to workbook publish method (#614)