| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \ |
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| |_|/ /
|/| | /
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes Bug 1087018
Change-Id: I1c2d34166ae85add86daab6a7483b63297d00f66
|
|\ \ \ |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|/ /
| |
| |
| | |
Change-Id: Ia1dfa85a81bae6620c2c24c0c28a589d46ed3b04
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes bug 1086063
Change-Id: I1ebc3243b6db242279b05424c99013dbcf703703
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fixes bug #1083956
Change-Id: I681227e9428778adb7824a1930a33cfa5ffa13a1
|
|\ \ \ \ \ |
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| | |/ / /
| |/| | | |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
Fixes bug #1084821
Change-Id: I1199d264b911036d142c6d1b58a41d740d795dd5
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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
|
|\ \ \ \ \ |
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | | |
Implements blueprint qpid-roundrobin-reconnect
Change-Id: I01b65e6c33a238663667e9b6023b90172f1b77dd
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | / /
| | |_|/ /
| |/| | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \ |
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | | |
Rearranged import order of openstack.common.rpc.matchmaker
Change-Id: I034a96e459763910adf51dc8f6642d6485208732
|
|\ \ \ \ \ |
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | | |
This gets the code coverage of the tests back up to 100%.
Change-Id: I737c1cfa52d10b3813237a9cb88b15211e0872c1
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
Commit 5b9cb4148 changed the way cfg support's positional arguments and
broke update.py. Use the new positional argument infrastructure.
Change-Id: I0dc8b5ec445daaf3b437eb524c6eb4b684e5a695
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
Looks like we just need to fix imports
Fixes Bug #1072633
Change-Id: Iac84ae3aadbe440f9b19e184f080320e4c6cca5f
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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
|