Config compare#2948
Conversation
|
Refer to this link for build results (access rights to CI server needed): |
d8f08df to
7e1e377
Compare
|
Refer to this link for build results (access rights to CI server needed): |
7e1e377 to
889b9c1
Compare
|
Refer to this link for build results (access rights to CI server needed): |
There was a problem hiding this comment.
We're not using the long option processing anywhere else.. Isn't the standard "flag" package sufficient?
If this is added, the source must be included in the vendor directory, license info properly documented in LICENSE and the appropriate lines added to .dependency_license and .rat-excludes. Is it worth doing that?
f2e619a to
e9bb960
Compare
|
Refer to this link for build results (access rights to CI server needed): |
e9bb960 to
cfa71da
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
cfa71da to
4f4f17a
Compare
|
Refer to this link for build results (access rights to CI server needed): |
4f4f17a to
e83599d
Compare
|
Refer to this link for build results (access rights to CI server needed): |
7289a18 to
dbf9d32
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
b1616c0 to
b4a09bd
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
Also changed some of the logging to use more reasonable levels, without unnecessarily verbose stack traces for info messages
…le set of servers common between two Traffic Ops instances
b4a09bd to
18678bd
Compare
|
Refer to this link for build results (access rights to CI server needed): |
18678bd to
b259831
Compare
|
Refer to this link for build results (access rights to CI server needed): |
b259831 to
da7e19b
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
|
||
| # TOSession Class | ||
| class TOSession(restapi.RestApiSession): | ||
| """ |
There was a problem hiding this comment.
Were all these whitespace changes really necessary? PEP8 recommends spaces over tabs https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces.
There was a problem hiding this comment.
I understand where you're coming from, but Tabs > spaces. Tabs are for indentation, spaces are for alignment. Also, consider from the first paragraph of PEP8:
This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.
So it's not only a suggestion, but a suggestion for Python code intended for the standard library.
There was a problem hiding this comment.
Regardless of whether or not tabs are better than spaces, following a set style guideline makes code easier to read when moving from project to project. In this case, spaces are preferred because they're consistent; a tab can be rendered differently in different views, whereas 4 spaces will always be rendered as 4 spaces. There are other PEP8 style guidelines that make a Python project read like Python, such as snake_case_function_names and CapWordsClassNames. It's like reading class my_java_class {...} in Java; it just doesn't read like Java.
There was a problem hiding this comment.
+1 on following PEP guidelines. I personally prefer tabs as well, but following the language idioms comes first.
In fact, I'd strongly support adopting a formatter (such as https://github.com/google/yapf) as a standard/requirement for the project, a la gofmt.
There was a problem hiding this comment.
I'd love to see us using something like that as well, especially since we've been adding a lot of Python into the codebase lately. IMO gofmt was a huge win for Go.
There was a problem hiding this comment.
I have a Pylint configuration file I'll include next time I take a pass at the TO client (it needs to be a real package and not that weird symlink thing).
I disagree that spaces are consistent, tabs are consistent. A tab is one character, always, and always represents an indentation level. Your editor can display them at any desired width per your preferences, without sacrificing the actual contents of the files. That PEP is not meant to force a style guide on anyone using Python, it's specifically for contributors to the reference implementation's standard library.
There was a problem hiding this comment.
You have to change your editor to choose a particular representation of the tab character, rather than it just being a consistent 4 spaces in any editor you use. For example, when writing the code you might have your editor set to 4 spaces for a tab. When viewing it in git diff, it might display as 8 spaces. In a GitHub PR it might be 6 spaces. It's just the style that's been chosen for Python for consistency and readability's sake.
Even though PEP8 mentions it is the style convention to be followed for the standard library, it's generally adopted by big open source Python projects (e.g. Django, OpenStack, Ansible). A major benefit to having a standard style of formatting is that you don't have to argue about the different ways things can be formatted; you just gofmt (or equivalent) the code and leave it at that. Generally for Python projects that is PEP8.
What does this PR do?
Adds a script to generate configuration file routes for the
comparetool. Also modifies thecomparetool to be compatible with plaintext API endpoints (like most config files) and read input from stdin for easy piping between the two.Which TC components are affected by this PR?
What is the best way to verify this PR?
First of all, be sure the documentation builds. Then, assuming the dependencies of the Traffic Ops Python client have been satisfied, try running the
traffic_ops/testing/compare/genConfigRoutes.pyscript (see documentation for usage) and verify the output with thetraffic_ops/testing/compare/compare.gotool (again, see documentation for usage)Check all that apply