summaryrefslogtreecommitdiff
path: root/nova/tests/unit/test_notifications.py
Commit message (Collapse)AuthorAgeFilesLines
* add tags field to instance.update notificationSujitha2017-04-211-0/+10
| | | | | | | | | | Tags field is added to the InstanceUpdatePayload based on the tags field fo the related Instance object. Adding tags to instance.create notification will be handled in the bp tag-instances-when-boot. Implements: bp additional-notification-fields-for-searchlight Change-Id: Ifad6487de200767fc16d035ad830c77bba49154a
* conf: added notifications groupMaciej Szankin2017-01-031-10/+13
| | | | | | | | | | | Notifications related configuration options have been moved from the default group to the ``notifications`` group. Also, ``default_notification_level`` has been renamed to avoid naming redundancy. Blueprint centralize-config-options-ocata Change-Id: I09dc358fabc84f7bf37d40d48b0652a10d9b8903
* Make notifications module use flavor capacity attributesDan Smith2016-07-121-0/+18
| | | | | | | This makes the notifications module use instance.flavor.$resource instead of instance.$resource. Change-Id: Ic31589aea0a2948179f6b3fb9cb759da4e2a2e78
* Transform instance.update notificationBalazs Gibizer2016-06-301-29/+116
| | | | | Change-Id: I4e1ca357322bdbcb95e4803001f4a7dc1bd37f04 Implements: bp versioned-notification-transformation-newton
* Merge "Remove invalid test of config option default_notification_level"Jenkins2016-06-131-25/+0
|\
| * Remove invalid test of config option default_notification_levelChangBo Guo(gcb)2016-06-091-25/+0
| | | | | | | | | | | | | | | | | | Config option default_notification_level only accepts values in [DEBUG, INFO, WARN, ERROR, CRITICAL], other value will lead ValueError, so don't test invalid value in Nova. Change-Id: I5431dcfd4f3b41833695c2559e737ee0d2961e87 Related-Bug: #1517839
* | Stop using mox stubs in tests/unit/fake_notifierBalazs Gibizer2016-06-101-1/+1
| | | | | | | | | | | | | | | | | | Replace 'stubs.Set' with 'stub_out' in the following files. * nova/tests/unit/fake_notifier.py Change-Id: Ie161780e748e3e8f1959a99d6d69e3518ccc958e Implements: blueprint remove-mox-newton
* | Move notification related code to separate packageBalazs Gibizer2016-06-081-3/+5
|/ | | | | | | | | | | | | To be able to separate the versioned notification related object model from the nova internal object model a new nova.notification.object package is introduced. As nova had nova/notifications.py already in the tree the code from that file is moved into the new nova.notification package as a first step. Implements: bp versioned-notification-transformation-newton Change-Id: I315f548180c260c22a2ebcf7b7cb56d284b6e580
* Merge "Fix invalid uuid warnings"Jenkins2016-05-191-1/+2
|\
| * Fix invalid uuid warningssrushti2016-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, unit testcases emit FutureWarnings from oslo.versionedobjects about invalid uuids as documented here[1]. This commit changes these tests to use valid uuids so that when they are run these warnings are no longer emitted. [1] http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField Closes-Bug: #1557378 Change-Id: I21a60e916e183f7c0fc6193d4b7caa88ae3b6d56
* | Merge "Fixes bug with notify_decorator bad getattr default value"Jenkins2016-05-111-0/+25
|\ \ | |/ |/|
| * Fixes bug with notify_decorator bad getattr default valueAndrei V. Ostapenko2016-03-201-0/+25
| | | | | | | | | | | | | | | | | | getattr tries to get method from notifier by its name in config. If it fails, string 'info' is returned and called. This patch changes default value from string 'info' to method notifier.info Closes-bug: #1496197 Change-Id: Id005de79980db3c8ea7256b360a2b2c47bfdace7
* | remove the use of import_object_nsSean Dague2016-04-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function dates back to I5eee3389c7719d5f361532b0eddaa249233283a5 when it was introduced to make it easier to seamlessly load drivers from out of tree. This no long is something we want to do. Also, the way this works it means that it makes it really hard to debug when an import of a driver fails (as it's masked out). This is the only use of the function in all of OpenStack, it should just go away as an anti-pattern. Tests were updated to pass, and the compute_driver flag was removed from tests that passed even when they now had completely bogus values. Change-Id: I65a537292aa8eda9f3d89e408caa50c445f2050a
* | remove glance deprecated configSean Dague2016-03-311-0/+2
|/ | | | | | | | | | This removes the very old glance config options which were deprecated in I9054bcfb7f5a4a31f0bbfd770c00c767f3d165ba in favor of glance.api_servers config option. This is required to clear out any default glance servers so that we could pull from the service catalog as a default in the future. Change-Id: Ie2d767c4422ef339d6dcb826f3c8ba3c7cf79f85
* Remove unused CONF importsMichael Still2016-02-151-3/+0
| | | | | | | | | | | While reviewing config centralization patches I realized that we have a fair few files where we import cfg or setup CONF, but never actually use config variables. This patch cleans those up, but I am sure we'll add more as we move more flags around. Change-Id: I5851bbae2fa198a4e9be149a5836bea813848d89
* config options: Centralise 'virt.driver' optionsStephen Finucane2016-02-111-3/+2
| | | | | | | | | Add options from 'virt.driver'. These options are part of the 'DEFAULT' group but are included in the "nova.conf.virt" file in hope that they can eventually be moved to their own group. Change-Id: Icf6084c156c4990ac60c778c28a48ae5ab97273a Implements: bp centralize-config-options
* Merge "Use stub_out and mock to remove mox:part 3"Jenkins2016-01-151-4/+3
|\
| * Use stub_out and mock to remove mox:part 3jichenjc2016-01-131-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change replaces the use of stubs in a few files with stub_out, which was introduced in test.py. Also, remove mox usage in some of the files. unit/test_block_device.py unit/test_context.py unit/test_crypto.py unit/test_metadata.py unit/test_notifications.py Part of bp:remove-mox Change-Id: Ibb8a87b34d5f238e08469883361297757a467765
* | Replace stubs.Set with stub_out (fakes)Diana Clarke2016-01-131-2/+2
|/ | | | | | | | | | | | | | | | | | | | | As part of the ongoing effort to stop using mox, start replacing stubs.Set calls with stub_out. Limit the scope of this patch to the following fake functions: - fake_get_instance_nw_info - stub_nw_info - stub_out_instance_quota - stub_out_networking - stub_out_nw_api - stub_out_nw_api_get_instance_nw_info - set_stub_network_methods - stub_out_network_cleanup - unset_stub_network_methods Part of bp:remove-mox Change-Id: I70215fb25ef25422786b96d33c91d8f1d4760a23
* Remove Instance object flavor helper methods only used in testsHans Lindgren2015-12-031-2/+1
| | | | | | | | | These methods used to help with on-the-fly conversion of stored flavor info from it's old location in system metadata to instance extra. Since this is no longer required and since the only remaning uses are in tests, remove the methods and fix the tests as needed. Change-Id: Ia96106602be5cb256f78e3fe71e908627120657a
* Fix notify_decorator errorsEdwin Zhai2015-08-111-0/+24
| | | | | | | | | | | * getattr is built-in function, so should not be used as attribute. * When ctxt is None, rpc.get_notifier('api').info(ctxt, name, body) leads NoneType exception at context.to_dict(). So we need guarantee one valid context here. Closes-Bug: #1476931 Change-Id: I25953467aca641448d25b2d63352f756ec3655aa
* Handle InstanceNotFound when sending instance update notificationMatt Riedemann2015-06-111-0/+30
| | | | | | | | | | | | | | | | | When Tempest (or any automated client) is waiting for an instance to be ACTIVE but goes to ERROR state, it immediately fails a test and deletes the instance. The instance could be deleted by the time the instance update notification processing happens so there is a race where that could fail with InstanceNotFound. That will get traced to the conductor logs and we should try to keep the conductor logs as clean as possible from expected exceptions. This handles InstanceNotFound and just logs it at debug rather than trace out the exception. Closes-Bug: #1455640 Change-Id: Iaee147051afb59f7991f8dfef3bd3072c28f829d
* Be more forgiving to empty context in notificationDavanum Srinivas2015-03-311-0/+70
| | | | | | | | | | | | We seem to call rpc.get_notifier('api').error(None, 'api.fault', payload) in notifications.py, where the first parameter is context. This eventually calls context.to_dict() in nova/rpc.py, which breaks for a NoneType object. So we should pick the current context from oslo_context or switch to the admin context. Co-Authored-By: Pranesh Pandurangan <praneshpg@gmail.com> Closes-Bug: 1360911 Change-Id: Ic37e184a56377739cd7cda5ba4bde236990fef9e
* Merge "Ensure publisher_id is set correctly in notifications"Jenkins2015-02-101-0/+3
|\
| * Ensure publisher_id is set correctly in notificationsDavanum Srinivas2015-02-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | We need to pass the service parameter else the publisher_id is set to "None.node-1". There are many code paths that end up in get_noftifier, so let's just handle it there just like we default to CONF.host. Also the self.notifier in the resource_tracker was not being used, so get rid of it. Closes-Bug: #1416435 Change-Id: I8838b961e49496cc85913a04bd99f9845ff308c3
* | Switch to using oslo_* instead of oslo.*Davanum Srinivas2015-02-061-1/+1
|/ | | | | | | | | | | | | | | | | | | The oslo team is recommending everyone to switch to the non-namespaced versions of libraries. Updating the hacking rule to include a check to prevent oslo.* import from creeping back in. This commit includes: - using oslo_utils instead of oslo.utils - using oslo_serialization instead of oslo.serialization - using oslo_db instead of oslo.db - using oslo_i18n instead of oslo.i18n - using oslo_middleware instead of oslo.middleware - using oslo_config instead of oslo.config - using oslo_messaging instead of "from oslo import messaging" - using oslo_vmware instead of oslo.vmware Change-Id: I3e2eb147b321ce3e928817b62abcb7d023c5f13f
* Fix up some instance object creation issues in testsDan Smith2015-01-291-2/+3
| | | | | | | This cleans up a lot of cruft (and offenses) in tests around creating instance objects with flavors. Change-Id: Ibf8ccd5fe896a436649d11038948bd47cb304632
* Changed testcase 'test_send_on_vm_change' to test vm changeNuman Siddique2014-11-301-2/+2
| | | | | | | | | This patch changed the test case NotificationsTestCase.test_send_on_vm_change to test the vm change instead of the task change Change-Id: I244c5eca5b5b2a254b14126d92e020f072714ade Closes-bug: #1397247
* Make notifications use Instance.get_flavor()Dan Smith2014-11-201-51/+52
| | | | | | | | | | | | | | This makes the notifications.info_from_instance() method use the Instance.get_flavor() method to retrieve flavor information, instead of assuming that it is in system_metadata. This requires that it is passed an Instance object, so this patch also converts the code to make that assumption (which needs doing anyway) and fixes remaining dict-using callers to pass the object. This will be required by a subsequent patch to refactor flavor storage. Related to blueprint flavor-from-sysmeta-to-blob Change-Id: I6e4e07807cb6cd173d54137d4fe8d9b1a0d49709
* move all tests to nova/tests/unitSean Dague2014-11-121-0/+394
As part of the split of functional and unit tests we need to isolate the unit tests into a separate directory for having multiple test targets in a sane way. Part of bp:functional-tests-for-nova Change-Id: Id42ba373c1bda6a312b673ab2b489ca56da8c628