diff options
-rw-r--r-- | .zuul.yaml | 1 | ||||
-rw-r--r-- | cliff/lister.py | 2 | ||||
-rw-r--r-- | cliff/tests/test_command.py | 20 | ||||
-rw-r--r-- | doc/requirements.txt | 4 | ||||
-rw-r--r-- | openstack-common.conf | 0 | ||||
-rw-r--r-- | test-requirements.txt | 2 |
6 files changed, 24 insertions, 5 deletions
@@ -20,7 +20,6 @@ zuul_work_dir: src/git.openstack.org/openstack/python-neutronclient - project: - name: openstack/cliff check: jobs: - cliff-tox-py27-neutronclient-tip diff --git a/cliff/lister.py b/cliff/lister.py index 93a6b86..e0fab01 100644 --- a/cliff/lister.py +++ b/cliff/lister.py @@ -50,7 +50,7 @@ class Lister(display.DisplayCommandBase): parser = super(Lister, self).get_parser(prog_name) group = self._formatter_group group.add_argument( - '-s', '--sort-column', + '--sort-column', action='append', default=[], dest='sort_columns', diff --git a/cliff/tests/test_command.py b/cliff/tests/test_command.py index 8e1a0f3..6aecff3 100644 --- a/cliff/tests/test_command.py +++ b/cliff/tests/test_command.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import argparse import functools from cliff import command @@ -42,6 +43,10 @@ class TestCommand(command.Command): help="The quick brown fox jumps " "over the lazy dog.", ) + parser.add_argument( + '-z', + help='used in TestArgumentParser', + ) return parser def take_action(self, parsed_args): @@ -128,3 +133,18 @@ class TestHelp(base.TestBase): width=78, ) self.assertIn(expected_help_message, parser.format_help()) + + +class TestArgumentParser(base.TestBase): + + def test_option_name_collision(self): + cmd = TestCommand(None, None) + parser = cmd.get_parser('NAME') + # We should have an exception registering an option with a + # name that already exists because we do not want commands to + # override global options. + self.assertRaises( + argparse.ArgumentError, + parser.add_argument, + '-z', + ) diff --git a/doc/requirements.txt b/doc/requirements.txt index f22cc9f..c022694 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,5 +1,5 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -sphinx>=1.6.2 # BSD -openstackdocstheme>=1.17.0 # Apache-2.0 +sphinx!=1.6.6,>=1.6.2 # BSD +openstackdocstheme>=1.18.1 # Apache-2.0 diff --git a/openstack-common.conf b/openstack-common.conf deleted file mode 100644 index e69de29..0000000 --- a/openstack-common.conf +++ /dev/null diff --git a/test-requirements.txt b/test-requirements.txt index dbb6402..1ebb594 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,7 +12,7 @@ coverage!=4.4,>=4.0 # Apache-2.0 # sphinx is required in test-requirements in addition to doc/requirements # because there is a sphinx extension that has tests -sphinx>=1.6.2 # BSD +sphinx!=1.6.6,>=1.6.2 # BSD # Bandit security code scanner bandit>=1.1.0 # Apache-2.0 |