summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Merge "Change Exception MissingArgs's string"Jenkins2012-12-061-6/+3
|\ \ \ \
| * | | | Change Exception MissingArgs's stringJoe Gordon2012-12-061-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error message in MissingArgs shows python names not the arg name the user will use in the CLI (see for example 'nova-manage flavor create') Change-Id: I544cede6ec60c8cde2438d1b378191271cec1aec
* | | | | Merge "Allow nova and others to override some logging defaults"Jenkins2012-12-064-0/+87
|\ \ \ \ \
| * | | | | Allow nova and others to override some logging defaultsDavanum Srinivas2012-12-064-0/+87
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - In log.py, indicate that logging module allows tweaking of just logging_context_format_string option - In cfg.py, add a method that can alter the default given the options and new default - add testcases for log.set_defaults and cfg.set_defaults Fixes LP #1083218 Change-Id: Iefdbce8505eb7a07f2b59d4ed7564b0146f1b0cd
* | | | | Merge "Allow exceptions to pass over RPC silently"Jenkins2012-12-065-7/+111
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Allow exceptions to pass over RPC silentlyDan Smith2012-12-065-7/+111
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When one service performs an operation on behalf of another, the act of passing back an exception (even a known one) causes a lot of scary log messages about the (presumed to be) error case. This patch adds a client_exceptions decorator common/rpc/common.py, which allows RPC services to declare the list of expected exceptions for each method. If such an exception is raised during the RPC dispatch, it is wrapped in a ClientException so that the RPC layer can gracefully pass it back without overly-verbose logging. This will allow us to fix nova bug 1084707 Change-Id: I4e7b19dc730342091fd70a717065741d56da4555
* | | | Merge "Fixing the trim for ListOp when reading from config file"Jenkins2012-12-062-1/+7
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/|
| * | Fixing the trim for ListOp when reading from config fileMichael Basnight2012-12-052-1/+7
| | | | | | | | | | | | | | | | | | Fixes Bug 1087018 Change-Id: I1c2d34166ae85add86daab6a7483b63297d00f66
* | | Merge "Fix qpid cast_to_server regression."Jenkins2012-12-052-3/+10
|\ \ \
| * | | Fix qpid cast_to_server regression.Russell Bryant2012-12-052-3/+10
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patches addresses a regression in the qpid driver for the cast_to_server and fanout_cast_to_server methods. The regression was introduced in 86952852c1dadd54f1294ae0adba01cfe827b8ce. There are test cases that cover this code, but unfortunately they are not being run by jenkins because python-qpid is not available in pypi. Fix bug 1086848. Change-Id: I89d4f81149f9a05c578b5ec544c5e34311484c6c
* | | Merge "Fix broken --version command"Jenkins2012-12-052-6/+94
|\ \ \ | |/ / |/| |
| * | Fix broken --version commandDavanum Srinivas2012-12-042-6/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for lazy loading of version string was broken. The way it breaks in glance and oslo is different. This patch is just for oslo. Here we end up overriding more methods in our lazy string class to make argparse happy and added test cases to make sure we don't break again. we also sure we cache the result of the lookup so we return the same version everytime and for performance. Added a few test cases as well. Fixes LP #1085984 Change-Id: I0635899c37fa8e5a7edf282907d2a5e04aa064cb
* | | Fix import order in openstack/common/lockutils.pyJoe Gordon2012-12-041-1/+1
|/ / | | | | | | Change-Id: Ia1dfa85a81bae6620c2c24c0c28a589d46ed3b04
* | Merge "Add a CLI argument validation utility"Jenkins2012-12-042-0/+464
|\ \
| * | Add a CLI argument validation utilityMark McLoughlin2012-11-292-0/+464
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blueprint oslo-cliutils In nova-manage and cinder-manage, we allow command arguments to be passed as optional or positional arguments. e.g. $> nova-manage floating create 10.0.0.1/28 $> nova-manage floating create --ip_range 10.0.0.1/28 are equivalent. Once nova-manage has collected those arguments, it calls the appropriate command function with them as positional and keyword arguments. If the user forgets to supply a required argument, they merely get a TypeError with little useful information. Improve the usability of these commands using a new utility function to check that the required arguments have been supplied and raise a useful exception if not. Change-Id: If6e4a9f222a30472bbfbcd06859865bd4e37e139
* | | Merge "Fixing modulename so eventlet will log properly."Jenkins2012-12-031-1/+1
|\ \ \ | | |/ | |/|
| * | Fixing modulename so eventlet will log properly.Michael Basnight2012-12-031-1/+1
| | | | | | | | | | | | | | | | | | Fixes bug 1086063 Change-Id: I1ebc3243b6db242279b05424c99013dbcf703703
* | | Merge "Fix set_default() with boolean CLI options"Jenkins2012-12-032-1/+24
|\ \ \
| * | | Fix set_default() with boolean CLI optionsMark McLoughlin2012-12-032-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Porting to argparse broke set_default() with boolean CLI options. The new test case shows this borkage. The issue is that, by default, argparse differs subtly from optparse in its handling of defaults for boolean options. Compare: >>> p = optparse.OptionParser() >>> p.add_option('--foo', action='store_true') >>> p.add_option('--bar', action='store_true', default=False) >>> p.parse_args([]) (<Values at 0x7f28aba066c8: {'foo': None, 'bar': False}>, []) to: >>> p = argparse.ArgumentParser() >>> p.add_argument('--foo', action='store_true') >>> p.add_argument('--bar', action='store_true', default=False) >>> p.add_argument('--blaa', action='store_true', default=None) >>> p.parse_args([]) Namespace(bar=False, blaa=None, foo=False) i.e. unless you specify a default for a boolean option, optparse defaults to None whereas argparse defaults to False. To get the same optparse behaviour with argparse, you need default=None. Change-Id: Ifc92a834c4ba59e939d80ac5de24d7051232f5b5
* | | | Merge "Improve cfg's argparse sub-parsers support"Jenkins2012-12-032-68/+224
|\| | |
| * | | Improve cfg's argparse sub-parsers supportMark McLoughlin2012-11-292-68/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for sub-parsers to be useful, you need some way of knowing which sub-parser was chosen during argument parsing. It's pretty obvious from the current sub-parsers test case that we don't have a convenient interface for this. One way of doing it is to use the 'dest' argument when adding sub-parsers: >>> subparsers = parser.add_subparsers(dest='cmd') >>> subparsers.add_parser('a') >>> subparsers.add_parser('b') >>> parser.parse_args(['a']) Namespace(cmd='a') The most sensible way to map this into cfg concepts is to register sub-parsers as an Opt. This way, we can make name and argument values of the sub-parser as an attribute on the ConfigOpts object: >>> def add_parsers(subparsers): ... a = subparsers.add_parser('a') ... a.add_argument('id') ... b = subparsers.add_parser('b') ... >>> CONF.register_cli_opt(SubCommandOpt('cmd', handler=add_parsers)) True >>> CONF(['a', '10']) >>> CONF.cmd.name, CONF.cmd.id ('a', '10') The handler method is a bit awkward, but each time cfg is to parse command line args it takes all the registered opts and creates a new argparse parser. So we need to be able to re-add the sub-parsers each time. Change-Id: I01bfd01bf8853cf57a9248b1663eb3da142366a4
* | | | Merge "Rename utils.py to strutils.py"Jenkins2012-12-033-76/+76
|\ \ \ \
| * | | | Rename utils.py to strutils.pyZhongyue Luo2012-11-303-76/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug #1083956 Change-Id: I681227e9428778adb7824a1930a33cfa5ffa13a1
* | | | | Merge "Fixes update.py issue with EOL style on Windows"Jenkins2012-12-031-1/+1
|\ \ \ \ \
| * | | | | Fixes update.py issue with EOL style on WindowsAlessandro Pilotti2012-12-011-1/+1
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes Bug #1075230 Files are saved with the OS EOL conversion unless "b" is specified in open(...). In this case we want to preserve the original EOL convention. Change-Id: Id756174d03c3e95db055d512ec4aa5a0eeb768b8
* | | | | Merge "Fixes import nit in test_zmq"Jenkins2012-12-031-2/+2
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Fixes import nit in test_zmqZhongyue Luo2012-11-301-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | Fixes bug #1084821 Change-Id: I1199d264b911036d142c6d1b58a41d740d795dd5
* / / / Use json instead of jsonutils in rpc.impl_fake.Russell Bryant2012-12-012-2/+21
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fake rpc backend uses json just to make sure the data that was passed in can be serialized. Our jsonutils module makes this check a no-op, because it will automatically convert the data we pass in as primitive types if needed. Change this module back to using the json module directly and add a comment about why we don't use jsonutils here. Also add a test that ensures that non-primitive types raise an exception in the fake rpc driver. Change-Id: I61f46242cb98c875a94d86283e30efb24cc580ad
* | | Merge "Provide i18n to those messages without _()"Jenkins2012-11-294-6/+10
|\ \ \
| * | | Provide i18n to those messages without _()Davanum Srinivas2012-11-284-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug 1081498 There are a few log messages without _(), but a lot messages with _(). Wrap these log messages with _() in order to make the code consistent. fix missing imports for _ Pass the log message and interpolation argument(s) to the logger separately remove extra parens rework the patch against latest trunk Change-Id: Ib0a7b0f9c57aadfbc2cfc477c6123b885c9c6060
* | | | Merge "Use Service thread group for WSGI request handling"Jenkins2012-11-293-14/+30
|\ \ \ \
| * | | | Use Service thread group for WSGI request handlingDavanum Srinivas2012-11-293-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reuse the pool from thread group in service.Service instead of creating a new green pool - Add ability to control the size of the pool in service.Service - Add a couple of tests for wsgi.Service() to test the size of pool a start/stop as well - Get rid of the wait method by using tg.add_thread - Get rid of pool in wsgi.Service - Added explicit property for host and port Fixes LP #1050379 Change-Id: I40507dc7887fb036ec594bb167cdaa42c278607e
* | | | | Merge "Qpid H/A cluster support"Jenkins2012-11-291-9/+14
|\ \ \ \ \
| * | | | | Qpid H/A cluster supportEugene Kirpichov2012-11-291-9/+14
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | Implements blueprint qpid-roundrobin-reconnect Change-Id: I01b65e6c33a238663667e9b6023b90172f1b77dd
* | | | | Merge "Hide the GroupAttr conf and group attributes"Jenkins2012-11-292-6/+18
|\ \ \ \ \
| * | | | | Hide the GroupAttr conf and group attributesMark McLoughlin2012-11-232-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason why an option group shouldn't have options called 'group' or 'conf'. Add a test case which would have failed because the 'conf' attribute would have been a ConfigOpts instance and fix it by making those attributes private. Change-Id: Ic3e41a546c0d1b7b6aae04e1dbac2933ac661f57
* | | | | | Merge "Fix regression with cfg CLI arguments"Jenkins2012-11-292-10/+16
|\ \ \ \ \ \ | |_|_|/ / / |/| | | / / | | |_|/ / | |/| | |
| * | | | Fix regression with cfg CLI argumentsMark McLoughlin2012-11-262-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug #1082279 Only options registered using register_cli_opt() should be available via the CLI, but since e42276a all options are added to the CLI. Also modify one of the existing unit tests to catch this problem. Change-Id: I742a4ae4e0fc17cd9ae5e4424c2edd38e2bc50a2
* | | | | Merge "Fixes import order"Jenkins2012-11-291-1/+1
|\ \ \ \ \
| * | | | | Fixes import orderZhongyue Luo2012-11-281-1/+1
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | Rearranged import order of openstack.common.rpc.matchmaker Change-Id: I034a96e459763910adf51dc8f6642d6485208732
* | | | | Merge "Add another duplicate opt test case"Jenkins2012-11-291-0/+5
|\ \ \ \ \
| * | | | | Add another duplicate opt test caseMark McLoughlin2012-11-231-0/+5
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | This gets the code coverage of the tests back up to 100%. Change-Id: I737c1cfa52d10b3813237a9cb88b15211e0872c1
* | | | | Merge "Fix broken --help with CommonConfigOpts"Jenkins2012-11-292-3/+12
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Fix broken --help with CommonConfigOptsMark McLoughlin2012-11-232-3/+12
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we switched to argparse, the way help strings are interpolated have changed and broken --help with the options registered by CommonConfigOpts. Fix and add a new test case which would catch the issue. Change-Id: I10e42efe4721e22ff41d0efbf390c805ccb9a6a0
* | | | Make project pyflakes clean.Monty Taylor2012-11-2816-30/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added both a tox test-env for pyflakes and fixed the current pyflakes errors. This did actually fix a couple of bugs. The CI team has started using pyflakes on its projects and also has started using oslo for things, so ignoring pyflakes warnings on the oslo code was starting to get old. However, additionally, pyflakes is pretty solid, so we should maybe consider gating on it across the board. (% locals() is the biggest thing that we do that it doesn't like) Change-Id: Iac1ca62db301892b7863711162fcbc74807eb24f
* | | | Replace try: import with extras.try_importMonty Taylor2012-11-282-5/+3
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block form: try: import foo except: foo = None is confusing to code analysis tools looking for redefinition. It's also a common enough pattern that someone else has encoded it into a library. Let's use that instead. Change-Id: I35a5c7a7e3595a51ba1ef1886c3965f463dba04a
* | | Merge "Fixup update.py after argparse breakage"Jenkins2012-11-271-15/+12
|\ \ \
| * | | Fixup update.py after argparse breakageKiall Mac Innes2012-11-231-15/+12
| |/ / | | | | | | | | | | | | | | | | | | Commit 5b9cb4148 changed the way cfg support's positional arguments and broke update.py. Use the new positional argument infrastructure. Change-Id: I0dc8b5ec445daaf3b437eb524c6eb4b684e5a695
* | / Fix common rpc to use common logging instead of python loggingDavanum Srinivas2012-11-244-4/+4
| |/ |/| | | | | | | | | | | | | Looks like we just need to fix imports Fixes Bug #1072633 Change-Id: Iac84ae3aadbe440f9b19e184f080320e4c6cca5f
* | Fix ListOpt to trim whitespaceDavanum Srinivas2012-11-242-1/+5
| | | | | | | | | | | | | | | | | | - throw in an extra strip() in the list parsing code - add a test case to verify that it works! Fixes LP #1079299 Change-Id: I4f0864c72ecd2569d0461c301acda395c87a93e0