| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While permissible syntactically, using brackets to wrap tested conditional is unnecessary
and potentially confusing. As without inserted whitspace the code may look as a function
call, rather than a statement and expression.
The construct is also considered erroneous by linters.
Closes-Bug: 1983593
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I0a086a8349e2a72cae024857e148fddc3556c319
(cherry picked from commit 56b700afcab95080182687f945c62cc96f650e45)
|
|
|
|
|
|
|
|
|
|
|
| |
Adding conflict_handler as attribut in the Command class in order to be
able to take control of this parameter and change to different behavior
that argparse is handling: error / resolve / ignore.
Callers will be able to override it and get a proper Parser object.
Change-Id: I327ece99a04bc8b2ebfa554dea643b1f2a456336
(cherry picked from commit 452fff3aadb01c41355a9254c6f21b76b5ed1609)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.
Until the requirements repository has as stable/wallaby branch, tests will
continue to use the upper-constraints list on master.
Change-Id: I711fb7f9a54ababd7eeaee5297e220ac872e7bff
|
|
|
|
| |
Change-Id: I7475ff5fbb2eee29b85c8897e6108cf149e1c0c7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PrettyTable was capped at a < 0.8, which meant we were getting the
veritably ancient 0.7.2 release first release in April 2013 (!) [1].
The project is now being maintained as a Jazzband project [2], meaning
we should switch to this new version.
The only significant change required here is that we no longer set the
'min_width' attribute since that actually does something - the wrong
thing - now. We want this attribute to set a lower bound on the wrap
width as opposed to an absolute minimum we can use, which is what
setting the 'min_width' attribute would do.
While we're here, we also remove a now useless bit of Python 2 code and
bump cmd2 to a slightly newer version.
[1] https://pypi.org/project/prettytable/#history
[2] https://github.com/jazzband/prettytable
Change-Id: Iceac729e7a9429e8ab25c60524a48d0aaeebeb37
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/requirements/+/774917
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Allow users to reverse sorting direction.
Change-Id: Iecd539139c5a7ce4abaaee2ff5632a2459437d51
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Implement the '__lt__' magic method, thus providing the minimal set of
rich comparison methods necessary to support sorting. This will allows
users using these formatters for the more basic types (i.e. not dicts)
to sort their output using the standard '--sort-column' option.
Change-Id: I08e1f1bc75fa6452f19dfb9d221c1daec194d58d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
One unfortunate change (or fortunate, depending on how you look at
types) in Python 3 is the inability to sort iterables of different
types. For example:
>>> x = ['foo', 'bar', None, 'qux']
>>> sorted(x)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'NoneType' and 'str'
Fortunately, we can take advantage of the fact that by providing a
function for the 'key' that returns a tuple, we can sort on multiple
conditions. In this case, "when the first key returns that two elements
are equal, the second key is used to compare." [1] We can use this to
first separate the values by whether they are None or not, punting those
that are not to the end, before sorting the non-None values normally.
For example:
>>> x = ['foo', 'bar', None, 'qux']
>>> sorted(x, key=lambda k: (k is None, k))
['bar', 'foo', 'qux', None]
We were already using this feature implicitly through our use of
'operator.itemgetter(*indexes)', which will return a tuple if there is
more than one item in 'indexes', and now we simply make that explicit,
fixing the case where we're attempting to compare a comparable type
with None. For all other cases, such as comparing a value that isn't
comparable, we surround things with a try-catch and a debug logging
statement to allow things to continue.
Note that we could optimize what we're done further by building a key
value that covers all indexes, rather than using a for loop to do so.
For example:
>>> x = [('baz', 2), (None, 0), ('bar', 3), ('baz', 4), ('qux', 0)]
>>> sorted(x, key=lambda k: list(
... itertools.chain((k[i] is None, k[i]) for i in (0, 1)))
... )
[('bar', 3), ('baz', 2), ('baz', 4), ('qux', 0), (None, 0)]
However, this would be harder to grok and would also mean we're unable
to handle exceptions on a single column where e.g. there are mixed types
or types that are not comparable while still sorting on the other
columns. Perhaps this would be desirable for some users, but sorting on
a best-effort basis does seem wiser and generally more user friendly.
Anyone that wants to sort on such columns should ensure their types are
comparable or implement their own sorting implementation.
[1] https://www.kite.com/python/answers/how-to-sort-by-two-keys-in-python
Change-Id: I4803051a6dd05c143a15923254af97e32cd39693
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2008456
Task: 41466
|
|\ \
| |/ |
|
| |
| |
| |
| |
| | |
Change-Id: I27a3689c2e22452c082764eed8d26cd8f3bbcd13
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
|/
|
|
| |
Change-Id: I040fccd1714dccd7a87aaf10d397ad3a3ef476d3
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is not part of the PTI and is currently broken. While discussions
are ongoing about removing it from every project, there's a definite
lean towards doing so. Let's do just that. We can re-add in the future
if necessary.
While we're here, we fix some indentation in 'tox.ini'.
Change-Id: Ib4784d9da96d05a54acdfbb3744af0cb053c0c6c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
There were some in both the docs and the demo application.
Change-Id: I58d14cd3a372f9bdf617cbfbcb5ce34169ac83f8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Replace the following items with Python 3 style code.
- six.moves
- six.PY2
- six.PY3
- six.string_types
- six.text_type
Change-Id: I1656b976864c8f2343e658a4abf432d30c151d0b
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
pkg_resources is used at runtime, making setuptools a runtime
dependency.
Change-Id: Ib1775a319e8ed953cb34e3c09809b8ca7a32b947
|
|\ \ \ |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so will switch to the correct
upper-constraints list automatically when the requirements repository branches.
Change-Id: Ia69a02b539230e65e25da65d5d76a9f650490256
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently, comparing instances of this fails:
>>> from cliff.columns import FormattableColumn
>>> class Test(FormattableColumn):
... def human_readable(self):
... return str(self._data)
...
>>> data = {'x': 'y'}
>>> x = Test(data)
>>> y = Test(data)
>>> x == y
False
Clearly it should not. Resolve this by implementing a custom comparison.
Change-Id: I4b96475ca6a689f4055dc5ea34b82b3867a65555
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: #2008320
Task: #41218
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
We also need to change the lower-constraint requirements to make them
py3.8 compatible. See https://bugs.launchpad.net/nova/+bug/1886298
Change-Id: Id06963dfdb20074cb9d8f0f2416a8e0937006059
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | | |
Change-Id: I76f87914149dc845ec53ec6a64342ca59f7dc4dc
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
cliff now uses storyboard as the bug tracker, but the documents
have not been updated.
Change-Id: Ie2ceda088f708dee2d6dd0877087e9a5c27e928f
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
With the advent of importlib, entry points are no long a setuptools-only
thing. Update the docs to reflect that.
Change-Id: I099f397ddb4d71879597cfe67ef2a1eff4a8d1af
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
| |
| |
| |
| |
| |
| | |
This can be removed because it's no longer a transitive dependency of oslo.i18n.
Change-Id: I2dabd2eea6d589952ecabf203f3c0d075672799f
|
|/
|
|
|
|
| |
In wallaby cycle, we should test py38 by default.
Change-Id: If1644b27dfe7b94d9fd709bbd9bc5d93afb2a374
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for wallaby.
See also the PTI in governance [1].
[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html
Change-Id: Ibde6e46f32d027992e65bd1446d3e84bcf0b3879
|
| |
| |
| |
| | |
Change-Id: Ib97cbf2c9b108932c437a6d69a6ab629244702b3
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we receive SIGINT, exit gracefully: run the clean_up method; don't
print a stacktrace; exit with error code 130 (128 + SIGINT).
Change-Id: I77687133d5482912523814a28e42f4f3a1a146d5
Story: 2008124
Task: 40846
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a new exception class for the help action to use to indicate
that the app should exit, instead of calling sys.exit(). This allows
argument parsing errors in interactive mode to print help without
exiting the entire application, while still being treated as a
short-cut to avoid every command plugin having to process argument
errors itself.
Change-Id: If882b305ff9186f97ece6c77ef8c1b888c24a72d
Story: 2008071
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Bifrost team got an errors on their CLI that also affects OSC. When
in interactive mode, if argparse fails to parse the input due to, say,
a missing parameter, argparse by default thows a SystemExit(2), but
cmd2 doesn't like it because that could've been a signal to stop the
CLI, so it breaks the interactive session. This fix aims to bypass that
and keep the CLI running so we don't have to start it at every parameter
we forget to type in.
Change-Id: I0e2006a9625e2f8dbdbc0e5921acfb3853a06ee9
Story: 2008071
Task: 40782
|
|
|
|
|
|
|
|
|
| |
Switch to using stevedore now so that when the cache implementation is
released all cliff applications can take advantage of the performance
benefits.
Change-Id: Ib7bf53091470b55ab87082d315ca283d3600a636
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
After [1] and [2], there is no need to cap the version of cmd2.
This will also fix the current "rally_openstack" import problems
experienced in the CI: http://paste.openstack.org/show/794701/
[1]https://review.opendev.org/#/c/712591/
[2]https://review.opendev.org/#/c/734629/
Change-Id: Ie15e3f5058c4bd104978d9f31f0590d6c795024b
|
|\ |
|
| |
| |
| |
| |
| | |
Closes-Bug: #1810213
Change-Id: I8c926152aa43359be376ec3dea83c42ecc499e80
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| | |
osc-lib adds support for named groups of commands. There's nothing
particularly openstackclient about this support, so add it here.
This way when we add defered plugin loading, it'll work.
Change-Id: Ia0260d2607f4a240b39e90da4b5b09e7cdfde04f
|
|/
|
|
|
|
|
|
|
|
| |
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we don't need it
in lower-constraints and requirements.
These changes will help us to drop `mock` from openstack/requirements
Change-Id: I81e07cd68e370422675b939863138e23de444eef
|
|
|
|
|
|
| |
These are for <3.2
Change-Id: I376e3601d5799e11590b2814714655692159de99
|
|
|
|
|
|
| |
testr isn't what we use anymore.
Change-Id: I4cb8b9ca41da6efd7053a5a7bacfce1654a73576
|
|
|
|
|
|
| |
We had it here for stestr which has moved on.
Change-Id: I5739d6b93e47b43ad3ec3726813cc706b8775157
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.
We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.
Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]
[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328
Change-Id: I7fa3bef0c7acd2b1f781bf12cc5a653cbc51d8c5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to openstackdocstheme 2.2.1 version. Using
this version will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems
Update Sphinx version as well.
Disable openstackdocs_auto_name to use 'project' variable as name.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html
Change-Id: I50caba24ba8d458e5061cf412b8f59e3815c58f7
|