summaryrefslogtreecommitdiffstats
path: root/openstack
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Make time comparison functions accept strings"Jenkins2013-01-041-0/+4
|\
| * Make time comparison functions accept stringsDan Smith2013-01-041-0/+4
| | | | | | | | | | | | | | This patch makes is_older_than() and is_newer_than() accept timestamps in string format, as returned from strtime(). Change-Id: I1dbf453cc08bd8aaeb4fee2491a1e8aa74f8bee3
* | Sanitize cells calls.Michael Still2013-01-041-10/+16
|/ | | | | | | Cells puts the data to be sanitized deeper into the message. We should get this into oslo ready for when cells lands. Change-Id: Ic5d111f11c979a179e0edcb314feb3f9d93f66ce
* Merge "Add a rpc envelope format version number."Jenkins2013-01-036-59/+149
|\
| * Add a rpc envelope format version number.Russell Bryant2013-01-026-59/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a message envelope that includes a envelope format version number. This message envelope will allow us to embed additional metadata later on, such as a signature for the message payload. Up to this point, we've deferred message serialization as a responsibility of the messaging library we're using by passing it a message as Python types and letting it deal with how to pass it over a network. This patch adds json serialization in the rpc layer of the application message payload before passing the message down into the messaging library. There are some benefits to be gained by doing a pass at serialization ourselves. As an example, we occasionally hit serialization bugs that only affect some messaging drivers. The kombu driver has always had a nice advantage. It uses anyjson internally for serializing messages, which we hook into using our jsonutils module. When there is a problem serializing, we automatically use to_primitive() to fix it. This patch allows all drivers to take advantage of this automatic message fix-up. This also creates a convenient common hook point for messages coming in and out of the system, regardless of the driver in use. While this changes the base format of the messages sent between nodes, it has been done in a backwards compatible manner. The new message format will not be used by default. The idea is that all nodes will be upgraded to a version that is capable of receiving the new format (Grizzly) before switching it on. We will turn it on post-Grizzly. Implement blueprint version-rpc-messages. Change-Id: Ib6b2d11ca42abaa64c40986d72233e7048e504a0
* | Merge "Move rootwrap code to openstack.common"Jenkins2013-01-033-0/+345
|\ \
| * | Move rootwrap code to openstack.commonThierry Carrez2012-12-203-0/+345
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copies current nova-rootwrap code to openstack.common, so that it can be reused by Cinder and Quantum. Implements blueprint common-rootwrap. Before it can be used in projects, update.py needs to grow the capability to deploy files in bin/ and etc/, as well as replacing a placeholder text by the destination project name in source files and binary names. In this proposed version, the placeholder text is "oslo". Change-Id: I8655d5b3cccacd1cc2225aa539339fb478615422
* | | Merge "Don't use exclusive queues for fanout and direct"Jenkins2013-01-031-4/+4
|\ \ \
| * | | Don't use exclusive queues for fanout and directVishvananda Ishaya2012-12-281-4/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of exclusive queues can cause issues on reconnect if the rabbit server hasn't deleted the queue already. We might as well use exclusive=False so that we can reconnect to the queue if necessary. Fixes bug 1094358 Change-Id: I35bd903737d6054e8856b0003b0b8af97fd21c91
* | | Merge "fix intermittent failures with deferred version test"Jenkins2013-01-031-35/+6
|\ \ \ | |_|/ |/| |
| * | fix intermittent failures with deferred version testDavanum Srinivas2012-12-251-35/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Need to get rid of the deferred string approach as the problem was overriding string methods is hard and flaky. There is just no other documented argparse hook to allow deferring of the version calculation as version passed in has to be a str or buffer. Added a test to try longer string and even run it in a loop just to be sure. Fixes LP #1087575 Change-Id: Icf83944d67b8ce5d3230627f3de10501da3276f2
* / Don't rely on os.wait() blockingDavanum Srinivas2013-01-021-1/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | Before this fix which was included in eventlet 0.10.0: https://bitbucket.org/which_linden/eventlet/issue/92/eventletgreen-override-of-oswaitpid the os.wait() wrapper in eventlet would not block if no child processes had exited. This was clearly buggy behaviour and os.wait() no blocks correctly. However, it appears it now does not return if the parent process was interrupted by a signal. This means that you can't kill the parent process and have the child processes cleaned up gracefully. To avoid all these issues, switch to non-blocking wait behaviour. We use WNOHANG with waitpid() to poll for an exited child process and, if there is none, we yield to other green threads and sleep for a short period. This means excessive CPU usage, though, which will be tracked by bug #1095346. Check pid to avoid some unnecessary warning/info messages in the logs Fixes LP #1094076 Change-Id: I783fac652376c2daa9d591403b9f4c1fe9523043
* Merge "Register the control_exchange RPC option"Jenkins2012-12-182-13/+9
|\
| * Register the control_exchange RPC optionMark McLoughlin2012-12-112-13/+9
| | | | | | | | | | | | | | | | | | | | | | Fixes bug #1031725 Have the control_exchange option be registered by Oslo, but allow projects to override the default of 'openstack' by doing e.g.: rpc.set_defaults(control_exchange='nova') Change-Id: Ic6e534d9a70a1cfc94207b78caa57e897cf78f63
* | Merge "Make wsgi.Server comply with service.Launcher interface"Jenkins2012-12-121-7/+12
|\ \ | |/ |/|
| * Make wsgi.Server comply with service.Launcher interfaceMichael Basnight2012-12-101-7/+12
| | | | | | | | | | | | fixes LP 1087369 Change-Id: Icf222b5bffe1f40a5c325ffe2a1b397f22713c00
* | Merge "Add deprecated --logdir common opt"Jenkins2012-12-081-0/+1
|\ \
| * | Add deprecated --logdir common optMark McLoughlin2012-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | --logfile and --logdir are aliases Nova has for the --log-file and --log-dir. If we're to support --logfile as a deprecated common option, we should do the same for --logdir. Change-Id: I16485a93070d9ad7789a287d5b035c6f270ffead
* | | Merge "Allow remote stdlib exceptions to be deserialized"Jenkins2012-12-081-0/+1
|\ \ \
| * | | Allow remote stdlib exceptions to be deserializedMark McLoughlin2012-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug #1086798 Add 'exceptions' to allowed_rpc_exception_modules so that stdlib exceptions (like NotImplementedError) can be deserialized from a RemoteError. Change-Id: I57f40fed2a86cc08fb64b81d648c71cd7db8027c
* | | | Merge "Add deprecated --logfile common opt."Jenkins2012-12-071-1/+2
|\ \ \ \ | | |/ / | |/| |
| * | | Add deprecated --logfile common opt.Dan Prince2012-12-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a deprecated common options for --logfile which is an alias for --log_file. This resolves some backwards compatability issues with the most recent oslo common code where --logfile was no longer a valid opt. Change-Id: I17b1277da94a2d81ae439d650a6d7321420dfe14
* | | | 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-062-0/+13
|\ \ \ \ \
| * | | | | Allow nova and others to override some logging defaultsDavanum Srinivas2012-12-062-0/+13
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-064-7/+58
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Allow exceptions to pass over RPC silentlyDan Smith2012-12-064-7/+58
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-061-1/+1
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/|
| * | Fixing the trim for ListOp when reading from config fileMichael Basnight2012-12-051-1/+1
| | | | | | | | | | | | | | | | | | Fixes Bug 1087018 Change-Id: I1c2d34166ae85add86daab6a7483b63297d00f66
* | | Merge "Fix qpid cast_to_server regression."Jenkins2012-12-051-0/+7
|\ \ \
| * | | Fix qpid cast_to_server regression.Russell Bryant2012-12-051-0/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-051-6/+26
|\ \ \ | |/ / |/| |
| * | Fix broken --version commandDavanum Srinivas2012-12-041-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-041-0/+66
|\ \
| * | Add a CLI argument validation utilityMark McLoughlin2012-11-291-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-031-1/+2
|\ \ \
| * | | Fix set_default() with boolean CLI optionsMark McLoughlin2012-12-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-031-26/+117
|\| | |
| * | | Improve cfg's argparse sub-parsers supportMark McLoughlin2012-11-291-26/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-031-0/+0
|\ \ \ \
| * | | | Rename utils.py to strutils.pyZhongyue Luo2012-11-301-0/+0
| | |/ / | |/| | | | | | | | | | | | | | | | | | Fixes bug #1083956 Change-Id: I681227e9428778adb7824a1930a33cfa5ffa13a1
* / | | Use json instead of jsonutils in rpc.impl_fake.Russell Bryant2012-12-011-2/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-293-5/+9
|\ \ \
| * | | Provide i18n to those messages without _()Davanum Srinivas2012-11-283-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-292-14/+14
|\ \ \ \
| * | | | Use Service thread group for WSGI request handlingDavanum Srinivas2012-11-292-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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