* Fix broken test with cmd2 0.7.0
Co-author: todd.leonhardt@gmail.com
Closes-Bug: #1672108
(cherry picked from I4bb02749a8fafccaff4ef7ce94ff0c4910fb67e6)
* Update cmd2 fix to still work with 0.6.7
I4bb02749a8fafccaff4ef7ce94ff0c4910fb67e6 fixed cmd2 0.7.0 but
broke <=0.7.0. Detect if Cmd.do_hi() is present to decide what
the response should be to support both cases
This can be reverted some time after cmd2 0.7.0 is in cliff's
requirements.txt as the minimum version.
(cherry picked from I3d42aa68303bed1c302e72d1eab861d355646bc7)
* Global requirements update
Update pbr requirements
Update setuptools requirements to deal with the appdirs failures
(cherry picked from Ia3833a9631e00911beecf76c965b1123d6230aed)
Depends-On: Ia95bbb7e4dd3503bf87559a118c0b197151fde16
Change-Id: I4bb02749a8fafccaff4ef7ce94ff0c4910fb67e6
Remove neutronclient-stable and openstackclient-stable which are designed to
run the latest cliff code/change under review against those 2 libraries to
reduce the chances of regressions. At some point in the past they ceased
to function as expected and rather then correct them remove them as they're
not used in the gate anyway.
Change-Id: I8fa88134c730ed55afc40c6513f135912cbed5e6
When there are two commands: one 'foo', that expects a positional
argument, and a second command 'foo bar'.
Trying to enter the command 'foo bar' will invoke the command
'foo' with position argument 'bar', and not the second command
'foo bar'.
This is due to the fact that the find command method first
checks for the first word as a command.
By trying first to match all arguments this problem is solved.
Closes-Bug: #1618673
Change-Id: I24ea39813ad30ec095ea18baad3a7b088fa8108f
TableFormatter doesn't allow to print empty table anyway.
To allow this feature was added optional parameter --print-empty.
By default, it's set to False and in this case if there is no data
to show then emit_list() will print nothing. Otherwise, empty table
will be printed. Appropriate unit test was added.
This solution doesn't affect existing approaches to use cliff.
Change-Id: I0e69f1cbcdd5b1280ea9d4d1523df29381cc349d
Closes-Bug: #1642263
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
The base class docstring has no useful information for real command
descriptions, so ignore it and return an empty string instead.
Change-Id: I61ccf0cf2e2840e927ca129de321320c0a27c031
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Add a class attribute to the search path for the one line description of
a command so implementations of commands can use translatable strings.
Change-Id: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Related-Bug: #1636209
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
When a resource property has dashes and colons and
the bash formatter is used, it actually breaks with
`command not found`.
For example, when doing:
eval `osc network show public --format shell`
The network resource has a property:
provider:network_type="vxlan"
Which results in:
"bash: provider:network_type=vxlan: command not found"
Change-Id: I57ca08c9dfd7ef022ab91d50ec42a98a6df08b09
Closes-Bug: #1616323
Currently only the first argument is shown in the error message.
In case of a multiword command, only first part is shown.
e.g When "openstack security grou list" command is run,
"security" subcommand is shown as invalid. This conveys a
wrong message to the user.
Closes-Bug: 1640031
Change-Id: I748ce46835638916279edead894e3f32c12abd51
Now that there is a passing gate job, we can claim
support for Python 3.5 in the classifier.
This patch also adds the convenience py35 venv.
Change-Id: Ia67e5efb2deb62942914b31d04f217308d0be304
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.
[H104] Files with no code shouldn't contain any license header nor
comments, and must be left completely empty.
[1] http://docs.openstack.org/developer/hacking/#openstack-licensing
Change-Id: I0efe587768fa1b8f1b6fc64ecfb56a2e57ebd9a9
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.
http://docs.openstack.org/developer/hacking/#imports
Change-Id: Ief01c4915b385b3135ec000f949755ab0d4883dd
Unicode must be encoded/decoded for text I/O streams, the
correct encoding for the stream must be selected and it must
be capable of handling the set of characters in the stream
or Python will raise a codec error. The correct codec is
selected based on the locale. Python2 uses the locales
encoding but only when the I/O stream is attached to a
terminal (TTY) otherwise it uses the default ASCII
encoding. The effect is internationalized text written to
the terminal works as expected but if command line output is
redirected (file or pipe) the ASCII codec is used and the
program aborts with a codec error.
The default I/O streams stdin, stdout and stderr can be
wrapped in a codec based on the locale thus assuring the
users desired encoding is always used no matter the I/O
destination. Python3 does this by default.
If the caller supplies an I/O stream we use it unmodified on
the assumption the caller has taken all responsibility for
the stream. But with Python2 if the caller allows us to
default the I/O streams to sys.stdin, sys.stdout and
sys.stderr we apply the locales encoding just as Python3
would do. We also check to make sure the main Python program
has not already already wrapped sys.stdin, sys.stdout and
sys.stderr as this is a common recommendation.
Note, the unit test enhancement included in this patch is limited to
assuring the I/O streams passed to the App constructor are wrapped or
not wrapped as expected. No attempt is made to assure codec errors
will not occur in a terminal because of the difficulty of constructing
such a test. Properly testing this probably would require spawing a
subshell but one can't use Python's subcommand because the I/O streams
are not attached to a TTY. One could set up a ptty (pseudo-terminal)
but experience has shown ptty's to be non-portable across operating
systems and environments, getting a ptty to work correctly in all
testing environments would be more work and hassle than is justified.
Change-Id: I8e85936dff0d5db29a66337c9ce60c70a8dee10a
Closes-Bug: 1603210
Signed-off-by: John Dennis <jdennis@redhat.com>
This commit removes outdated announce.rst. We already have the latest
documents such as README.rst, index.rst, history.rst, etc.
Change-Id: Ibda5fb3f0a1b5bc419ee8f788d9c42e65adfb0f7