summaryrefslogtreecommitdiff
path: root/openstackclient/common/parseractions.py
Commit message (Collapse)AuthorAgeFilesLines
* osc-lib: parseractionsDean Troyer2016-06-131-149/+8
| | | | | | | Leave parseractions.py and test_parseractions.py as a sanity check during the deprecation period. Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
* Merge "Error handling for KeyValueAction class."Jenkins2016-06-081-1/+3
|\
| * Error handling for KeyValueAction class.Huanxuan Ao2016-06-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix i18n supports in commomHuanxuan Ao2016-06-071-6/+8
|/ | | | | | | | I checked all the files in openstackclient/common and fixed the missing i18n supprots. Change-Id: Id7f76a24aae663f5832ef9bcf1bd5a6b7081af24 Partial-bug: #1574965
* remove assert in favor an if/elseMichael McCune2016-05-021-3/+2
| | | | | | | | | | | | | | 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
* fix: Exception message includes unnecessary class argsJas2016-02-291-2/+2
| | | | | | | | | 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
* Add MultiKeyValueAction to custom parser actionTang Chen2016-02-271-0/+81
| | | | | | | | | | | | | | 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
* Fix the bug of "openstack console log show"xiexs2015-11-091-0/+15
| | | | | | | | The behaviors are inconsistent while different negative line numbers specified. Change-Id: I2573f3e789f5603c896758971830ffc0b94c5e2b Closes-Bug: #1512263
* Fix PEP8 H405 errorsDean Troyer2014-06-271-3/+12
| | | | Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012
* Add security group commandsDean Troyer2013-07-291-0/+24
| | | | | | | | | | | | | | * 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
* Tweak volume commands and add k=v argparse actionDean Troyer2013-05-241-0/+34
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