11 Commits

Author SHA1 Message Date
Dean Troyer
be192676bd osc-lib: parseractions
Leave parseractions.py and test_parseractions.py as a sanity check during the
deprecation period.

Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
2016-06-13 10:55:44 -05:00
Jenkins
c272476b7b Merge "Error handling for KeyValueAction class." 2016-06-08 04:30:58 +00:00
Huanxuan Ao
cf12239773 Error handling for KeyValueAction class.
The set --property command requires that the input match
the "key=value" type, but if the type don't match, the return
value will be None, and the command still can be implemented
successfully, this may confuse the users. I think we should
raise exception if the argument type don't match "key=value".
So I make some changes in KeyValueAction class in this patch.

Change-Id: I14e64922faa7e083bc8b5e7e1cac41ef8117c224
Closes-Bug: #1589935
2016-06-08 10:15:19 +08:00
Huanxuan Ao
b36d521ff6 Fix i18n supports in commom
I checked all the files in openstackclient/common
and fixed the missing i18n supprots.

Change-Id: Id7f76a24aae663f5832ef9bcf1bd5a6b7081af24
Partial-bug: #1574965
2016-06-07 19:56:00 +08:00
Michael McCune
b33ee3daf6 remove assert in favor an if/else
the assert usage in the NonNegativeAction has the potential to allow
unexpected behavior when the python is byte-compiled with optimization
turned on.

Changes
* remove assert in favor of if/else in NonNegativeAction class
* add type specifier to parser arguments for non-negative actions
* correct tests for new int based values

Change-Id: I093e7440b8beff4f179e2c4ed81daff82704c40e
Closes-Bug: #1576375
2016-05-02 15:11:45 -04:00
Jas
b8d72cee27 fix: Exception message includes unnecessary class args
Fix misusages of ArgumentTypeError which causes a tuple of
class instance and error message string to be printed rather than just the
error message string itsself.

Change-Id: I0e997f86bb6603930cc92e90efcb48155f62ffb5
Closes-bug: #1551426
2016-02-29 16:06:05 -06:00
Tang Chen
ada06f4dc3 Add MultiKeyValueAction to custom parser action
Class MultiKeyValueAction will be used to parse arguments like this:

--route destination=xxx,gateway=xxx --route destination=yyy,gateway=yyy

The result is a list like this:

[{destination:xxx, gateway:xxx}, {destination:yyy, gateway:yyy}]

This action also contain validation of the parameters.

Change-Id: Ie3aa8635c6a13fc2e429fe6922acd681dc7244cf
2016-02-27 03:53:32 +08:00
xiexs
ea63553925 Fix the bug of "openstack console log show"
The behaviors are inconsistent while different
negative line numbers specified.

Change-Id: I2573f3e789f5603c896758971830ffc0b94c5e2b
Closes-Bug: #1512263
2015-11-09 04:22:09 -05:00
Dean Troyer
a78d75f290 Fix PEP8 H405 errors
Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012
2014-06-27 09:12:38 -05:00
Dean Troyer
c94e262df8 Add security group commands
* Add security group: create, delete, list, set, show
* Add server: add secgroup, remove secgroup
* Add security group rule: create, delete, list
* Add Oslo's strutils and gettextutils

* Adds parseractions.RangeAction() to handle option arguments of either a single number
  or a range of numbers: '--port 25'  or '--port 1024:65535'

Blueprint: nova-client

Change-Id: Iad2de1b273ba29197709fc4c6a1036b4ae99725f
2013-07-29 19:07:22 -05:00
Dean Troyer
ea9ec1c6bc Tweak volume commands and add k=v argparse action
Basic cleanups:
* change metadata to property
* add new KeyValueAction to parse the property options
* multiple properties can be set using multiple --property args
* consistent formatting
* do lookups for volume args

Change-Id: Ib6c43f01ad46b395aee8c61e886f42e2a5f5573e
2013-05-24 15:02:52 -05:00