This patch fixes the pep8 issues of the tool scripts and
configures tox to run pep8 on the tools directory.
Two hacking rules have been modified to ignore the tool directory as both
rules are checking oslo usage which is not critical in case of tools
- N310 use timeutils instead of datetime module
- N324 use jsonutils instead of json module
The tools/xenserver directory is still excluded from pep8 as it contains
scripts that are expected to run on dom0 with python2.4 therefore the
following rules cannot be meaningfully followed
- H231 Python 3.x incompatible 'except x,y:' construct
- H233 Python 3.x incompatible use of print operator
Change-Id: Icfd9e708a2ca1e421676b410e41807b2e630718f
oslo.i18n provides the i18n functions that were provided by
oslo-incubator's gettextutils module. Some tests that were
using internal details of the library were removed.
Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.
Also a check is added to hacking to detect if they are re-added.
Change-Id: I347307a5145b2760c69085b6ca850d6a9137ffc6
Closes-Bug: #1229324
The exising schema_diff code had the DB URL format hard-coded which made it
difficult to work with since different environments with have different
user/password configurations.
A more flexible way to handle this, is to have the DB URL specified directly
on the command-line.
Change-Id: I313bb616e439072e007c886a7f131efc6a61f6df
This gets rid of a SQLAlchemy deprecation warning when using this tool w/
PostgreSQL:
The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to
'postgresql'. The new URL format is
postgresql[+driver]://<user>:<pass>@<host>/<dbname>
This appears to have been deprecated in the SQLAlchemy 0.6 series so I think we
are Okay to remove it now.
Change-Id: If8fdf822ba452b387e9f2f3ec7c9157e4ae932f9
This is for Python 3 compatibility, since Python 3 does not support
the print statement, only the print function. (Python 2.6 and 2.7
support both, depending on whether a __future__ import is used.)
Paths containing "xen" were left alone, because of comments in a
couple of the files indicating that the XenServer code needed to be
compatible with Python 2.4.
Fixes bug 1226943
Change-Id: I23b804a4d99500b4acf81dd19645ab06dfcc9f1c
Previous _ was monkey patched into builtins whenever
certain modules were imported. This removes that and
simply imports it when it is needed.
Change-Id: I0af2c6d8a230e94440d655d13cab9107ac20d13c
Provide i18n to some exceptions that were not
provided before.
Change-Id: Ia320ba5f12e82686c8ee7973a77f152eb4b02bd4
Signed-off-by: Chuck Short <chuck.short@canonical.com>
This patch removes some assumptions from the tool and turns it in to a
generalized schema diffing tool where any two versions of the DB schema,
represented by branch-version pairs, can be diffed.
To reflect the more genernal nature, the name was changed to
schema_diff.py.
Change-Id: I4dc233fa2d4b084779922893f76baa753fe2c126