Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 10, 2015, 5:44 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs (updated) - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75929 --- Ship it! Master (48dc4c7) is green with this patch. ./build-support/jenkins/build.sh I will refresh this build result if you post a review containing @ReviewBot retry - Aurora ReviewBot On March 10, 2015, 5:44 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 10, 2015, 5:44 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75980 --- src/main/python/apache/aurora/client/api/__init__.py https://reviews.apache.org/r/31869/#comment123343 Revert this - self will correctly find the class field. src/main/python/apache/aurora/client/cli/__init__.py https://reviews.apache.org/r/31869/#comment123344 My understanding was that zmanji was attempting to remove AuroraCommandContext and patch print instead. Perhaps you and him should come to a consensus. src/main/python/apache/aurora/client/cli/jobs.py https://reviews.apache.org/r/31869/#comment123346 revert to use self so that subclass delegation will work. - Kevin Sweeney On March 10, 2015, 10:44 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 10, 2015, 10:44 a.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
On March 11, 2015, 12:08 a.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/cli/__init__.py, line 282 https://reviews.apache.org/r/31869/diff/3/?file=890382#file890382line282 My understanding was that zmanji was attempting to remove AuroraCommandContext and patch print instead. Perhaps you and him should come to a consensus. Did he not express agreement by giving a ship-it on this diff? On March 11, 2015, 12:08 a.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/api/__init__.py, line 134 https://reviews.apache.org/r/31869/diff/3/?file=890381#file890381line134 Revert this - self will correctly find the class field. Done. On March 11, 2015, 12:08 a.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/cli/jobs.py, line 681 https://reviews.apache.org/r/31869/diff/3/?file=890383#file890383line681 revert to use self so that subclass delegation will work. Done. - Bill --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75980 --- On March 10, 2015, 5:44 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 10, 2015, 5:44 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
On March 10, 2015, 5:08 p.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/cli/__init__.py, line 282 https://reviews.apache.org/r/31869/diff/3/?file=890382#file890382line282 My understanding was that zmanji was attempting to remove AuroraCommandContext and patch print instead. Perhaps you and him should come to a consensus. Bill Farner wrote: Did he not express agreement by giving a ship-it on this diff? We can address that problem another time. Consistent use of context and print_error will help solve that problem later. - Zameer --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75980 --- On March 10, 2015, 10:44 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 10, 2015, 10:44 a.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review76007 --- Ship it! LGTM once `self` or `cls` are used in place of class names. - Kevin Sweeney On March 10, 2015, 5:17 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 10, 2015, 5:17 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 11, 2015, 12:17 a.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs (updated) - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
On March 10, 2015, 5:08 p.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/cli/__init__.py, line 282 https://reviews.apache.org/r/31869/diff/3/?file=890382#file890382line282 My understanding was that zmanji was attempting to remove AuroraCommandContext and patch print instead. Perhaps you and him should come to a consensus. Bill Farner wrote: Did he not express agreement by giving a ship-it on this diff? Zameer Manji wrote: We can address that problem another time. Consistent use of context and print_error will help solve that problem later. Aha didn't see that. Carry on then. - Kevin --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75980 --- On March 10, 2015, 5:17 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 10, 2015, 5:17 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 11, 2015, 12:26 a.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs (updated) - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review76019 --- Ship it! Master (b53e023) is green with this patch. ./build-support/jenkins/build.sh I will refresh this build result if you post a review containing @ReviewBot retry - Aurora ReviewBot On March 11, 2015, 12:26 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 11, 2015, 12:26 a.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
On March 9, 2015, 8:17 p.m., Maxim Khutornenko wrote: src/main/python/apache/aurora/client/cli/jobs.py, line 679 https://reviews.apache.org/r/31869/diff/1/?file=889600#file889600line679 why not just context? Done. - Bill --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75761 --- On March 9, 2015, 8:10 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 8:10 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75762 --- src/main/python/apache/aurora/client/api/__init__.py https://reviews.apache.org/r/31869/#comment123019 Why this change (removing the root Error class)? src/main/python/apache/aurora/client/base.py https://reviews.apache.org/r/31869/#comment123016 Override isn't needed here. You can just leave the class body blank. src/main/python/apache/aurora/client/cli/jobs.py https://reviews.apache.org/r/31869/#comment123024 Rather than pass this have it use the instance field or make it a classmethod. - Kevin Sweeney On March 9, 2015, 1:10 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 1:10 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
On March 9, 2015, 8:21 p.m., Zameer Manji wrote: src/test/python/apache/aurora/client/cli/test_create.py, line 277 https://reviews.apache.org/r/31869/diff/1/?file=889602#file889602line277 Use pytest.raises for tests where you expect an exception to be raised: http://pytest.org/latest/assert.html Thanks, i should have looked harder for the convention here. - Bill --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75760 --- On March 9, 2015, 8:10 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 8:10 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75765 --- Ship it! Ship It! - Zameer Manji On March 9, 2015, 1:10 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 1:10 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75761 --- Ship it! src/main/python/apache/aurora/client/cli/jobs.py https://reviews.apache.org/r/31869/#comment123014 why not just context? - Maxim Khutornenko On March 9, 2015, 8:10 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 8:10 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75760 --- src/test/python/apache/aurora/client/cli/test_create.py https://reviews.apache.org/r/31869/#comment123011 Use pytest.raises for tests where you expect an exception to be raised: http://pytest.org/latest/assert.html src/test/python/apache/aurora/client/cli/util.py https://reviews.apache.org/r/31869/#comment123013 +100 - Zameer Manji On March 9, 2015, 1:10 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 1:10 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 8:39 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs (updated) - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75812 --- src/main/python/apache/aurora/client/base.py https://reviews.apache.org/r/31869/#comment123121 As this is only raised from a single place prefer declaring it there and matching the convention in [the style guide](https://github.com/twitter/commons/blob/master/src/python/twitter/common/styleguide.md#best-practices) (number 6). I don't have a strong opinion on the merits of this practice, but it is a convention across our code whose change I think is orthogonal to the purpose of this diff. src/main/python/apache/aurora/client/base.py https://reviews.apache.org/r/31869/#comment123120 To be clear my suggestion was to remove the constructor and leave the docstring. Overriding a constructor without changing its behavior just adds noise and is inconsistent with the convention used through most of the codebase. src/test/python/apache/aurora/client/cli/test_create.py https://reviews.apache.org/r/31869/#comment123119 You don't actually need to use the pytest API for this - since we're on python 2.7 and you have already subclassed `TestCase` you can use [self.assertRaises](https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertRaises). - Kevin Sweeney On March 9, 2015, 1:39 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 1:39 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner
Re: Review Request 31869: Catch only known Exception types in the client.
On March 9, 2015, 11:39 p.m., Kevin Sweeney wrote: src/test/python/apache/aurora/client/cli/test_create.py, line 277 https://reviews.apache.org/r/31869/diff/2/?file=889611#file889611line277 You don't actually need to use the pytest API for this - since we're on python 2.7 and you have already subclassed `TestCase` you can use [self.assertRaises](https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertRaises). I have no skin in this game, but i prefer to conform and minimize the ways of doing things. In this case, `pytest.raises` wins by the numbers: ``` $ grep -RI pytest.raises src/test/python/ | wc -l 69 $ grep -RI assertRaises src/test/python/ | wc -l 6 ``` On March 9, 2015, 11:39 p.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/base.py, lines 220-221 https://reviews.apache.org/r/31869/diff/2/?file=889607#file889607line220 To be clear my suggestion was to remove the constructor and leave the docstring. Overriding a constructor without changing its behavior just adds noise and is inconsistent with the convention used through most of the codebase. Aha, i didn't realize that `message` is a first-class property on `BaseException`. Done. On March 9, 2015, 11:39 p.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/base.py, line 217 https://reviews.apache.org/r/31869/diff/2/?file=889607#file889607line217 As this is only raised from a single place prefer declaring it there and matching the convention in [the style guide](https://github.com/twitter/commons/blob/master/src/python/twitter/common/styleguide.md#best-practices) (number 6). I don't have a strong opinion on the merits of this practice, but it is a convention across our code whose change I think is orthogonal to the purpose of this diff. Ok, i'll invert this so that `AuroraClientAPI.Error` is caught in `CommandLine`. As we discussed offline, this is a lesser abstraction violation. - Bill --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/#review75812 --- On March 9, 2015, 8:39 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31869/ --- (Updated March 9, 2015, 8:39 p.m.) Review request for Aurora, Kevin Sweeney and Zameer Manji. Bugs: AURORA-1176 https://issues.apache.org/jira/browse/AURORA-1176 Repository: aurora Description --- As indicated by some changes in tests - there were legitimate issues hiding behind this catch. After this change, the client will allow unhandled exceptions to surface in their full glory. Diffs - src/main/python/apache/aurora/client/api/__init__.py 194629f61192c1d7d5e7064e9226adf26d03e890 src/main/python/apache/aurora/client/base.py d550c8eeed91f0967e281957b71fcefb0b4cf3b8 src/main/python/apache/aurora/client/cli/__init__.py 4d9ef09749e3075b9d9e2ae1db311e60f7bdb4ee src/main/python/apache/aurora/client/cli/jobs.py 286b2182d5fe25703882f0b367739ad03d6c8fe8 src/test/python/apache/aurora/client/cli/test_api_from_cli.py b855c3c2d74125738d2106e18a9e9b0ebed6ac4b src/test/python/apache/aurora/client/cli/test_create.py 459d157155f74b6a3d140b85d3b7f0364367 src/test/python/apache/aurora/client/cli/test_kill.py 7aad34a2fe5591937c5bca890751073439e3a1a6 src/test/python/apache/aurora/client/cli/test_supdate.py 1806769426a196793481f948892f5474df8dd665 src/test/python/apache/aurora/client/cli/util.py b65970a2717a1f36767c61e5e09c980b04895f01 Diff: https://reviews.apache.org/r/31869/diff/ Testing --- Thanks, Bill Farner