| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This continues on from I81fec10535034f3a81d46713a6eda813f90561cf and
removes all other references to 'instance_type' where it's possible to
do so. The only things left are DB columns, o.vo fields, some
unversioned objects, and RPC API methods. If we want to remove these, we
can but it's a lot more work.
Change-Id: I264d6df1809d7283415e69a66a9153829b8df537
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
| |
| |
| |
| | |
Change-Id: Ic16c575c8f36e8a3c50b6e302b9fdf961cb3ed22
|
|/
|
|
|
|
|
|
|
|
|
| |
The fake_notifier uses module globals and also needs careful stub and
reset calls to work properly. This patch wraps the fake_notifier into a
proper Fixture that automates the complexity.
This is fairly rage patch but it does not change any logic just redirect
calls from the fake_notifier to the new NotificationFixture
Change-Id: I456f685f480b8de71014cf232a8f08c731605ad8
|
|
|
|
|
|
|
|
|
| |
This one is a little more involved because there are persistent objects
and versioned notifications to worry about, neither of which we can
remove right now.
Change-Id: Ic7c330ee1cccdc44a2a555c16cb6090eecbf6ce1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
| |
There's more to be done here around making the cached objects look like
something that would be generated by neutron, but this is good enough
for now.
Change-Id: I08aa4d581720b0f6cd1dabccc98dac210d1a1663
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Strip out everything matching '(is|use)_neutron', except the tests for
nova-network code and two other places that these tests rely on. Along
the way, remove a whole load of apparently unnecessary mocking that
clearly wasn't caught when we switched over the bulk of testing to use
the neutron network driver.
Change-Id: Ifa9c5c468400261a5e1f66b72c575845173a4f8f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The deprecated 'default_flavor' option has been removed.
The following methods in nova/compute/flavors.py
have been removed because they are only used in unit tests.
* get_default_flavor
* get_flavor_by_name
Change-Id: If1e461da382f707be2b5ba89f74f77269f0909dd
|
|
|
|
|
|
|
|
|
|
|
|
| |
oslo.utils release 3.37.0 [1] introduced uuidsentinel [2]. This change
rips out nova's uuidsentinel and replaces it with the one from
oslo.utils.
[1] https://review.openstack.org/#/c/599754/
[2] https://review.openstack.org/#/c/594179/
Change-Id: I7f5f08691ca3f73073c66c29dddb996fb2c2b266
Depends-On: https://review.openstack.org/600041
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With a small improvement on NeutronFixture that allows creating more
than two ports we can let our tests to exercise and therefore cover
most of the neutronv2/api code as well. To do that this path removes a
lot of fake_network.set_stub_network_methods() calls from the tests.
The remaining calls are not that trivial to remove so those are left in
for a later patch.
The numa functional tests uses the libvirt fixture and during the guest
config xml generation it tries to instantiate OVOs from os_vif. To make
this work the libvirt fixture has to make sure that the
os_vif.initialize() is called as that call registers the OVOs.
Change-Id: I1dbccc2be6ba79bf267edac9208c80e187e6256a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The instance action notifications contain the user id and the
project id of the owner of the instance. However an instance
action might be initiated by another user. It could be another
user from the same project or can be an admin from the admin project.
To be able to distinguish between the user who initiated the instance
action from the user owning the instance we need to add two new
fields to the instance action notifications, action_initiator_user
and action_initiator_project
Change-Id: I649d8a27baa8840bc1bb567fef027c749c663432
Closes-bug: #1744658
Blueprint: add-action-initiator-to-instance-action-notifications
|
|
|
|
|
|
|
|
|
|
| |
These were deprecated in Queens:
Id793ac2c5cdc5dc473f95eac53b77617a1e389da
And can now be removed.
Change-Id: I27518d1154ec09c57700905bc58ae6a3ce1d8049
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The system_metadata argument to info_from_instance() was not used
so it's removed in this change, along with all callers of that
method, which goes quite a ways.
Also, the docstring for the system_metadata argument to
notify_usage_exists() is updated since it is passed in one
specific place: rebuild with a new image. In that case, nova-api
saves off the original instance system_metadata before resetting
the system_metadata based on the new image to rebuild, which is
then passed down through nova-conductor and nova-compute where
it eventually gets used to override "image_meta" in the payload
created in info_from_instance(). It's weird, yes, and essentially
means that for legacy versioned notifications, the instance payload
will always contain the image_meta for the instance before it's
rebuilt with the new image, which is something we don't do for
versioned notifications.
Test test_local_delete_without_info_cache is removed since it's
(1) weird in that it is doing mox-like stuff in a mock-based
test and (2) the code it was meant to test from change
Ie0bba032615d3da06cdd95b221beb37a9b8a377d no longer exists.
Change-Id: Ia1820334dcaceca9d7fa874dd7c553fa1c5befec
Closes-Bug: #1764390
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on the description of the notify_on_api_faults config option [1]
and the code that uses it [2] nova sends and api.fault notification
if the nova-api service encounters an unhandle exception.
There is a FaultWrapper class [3] added to the pipeline of the REST
request which catches every exception and calls the notification sending.
Based on some debugging in devstack this FaultWrapper never catches any
exception. Every REST API method is decorated with expected_errors
decorator [5] which as a last resort translate the unexpected exception
to HTTPInternalServerError. In the wsgi stack the actual REST api call is
guarded with ResourceExceptionHandler context manager [7] which translates
HTTPException to a Fault [8]. Then Fault is catched and translated to
the REST response [7]. This way the exception never propagates back to
the FaultWrapper and therefore the api.fault notification is never emitted.
Based on the git history of the expected_errors decorator this notification
was never emitted for v2.1 API and as the v2.0 API now supported with the
same codebase than v2.1 it is not emitted for v2.0 calls either. As nobody
reported a bug I assume that nobody tried to use this notification for a very
long time. Therefore instead of fixing this bug this patch propses to remove
the dead code.
See a bit more detailed description on the ML [9].
[1] https://github.com/openstack/nova/blob/0aeaa2bce8ad15bc2f28e00b30d688514b992e13/nova/conf/notifications.py#L49
[2] https://github.com/openstack/nova/blob/0aeaa2bce8ad15bc2f28e00b30d688514b992e13/nova/notifications/base.py#L84
[3] https://github.com/openstack/nova/blob/0aeaa2bce8ad15bc2f28e00b30d688514b992e13/nova/api/openstack/__init__.py#L78
[5] https://github.com/openstack/nova/blob/0aeaa2bce8ad15bc2f28e00b30d688514b992e13/nova/api/openstack/extensions.py#L325
[7] https://github.com/openstack/nova/blob/0aeaa2bce8ad15bc2f28e00b30d688514b992e13/nova/api/openstack/wsgi.py#L637
[8] https://github.com/openstack/nova/blob/0aeaa2bce8ad15bc2f28e00b30d688514b992e13/nova/api/openstack/wsgi.py#L418
[9] http://lists.openstack.org/pipermail/openstack-dev/2017-June/118639.html
Change-Id: I608b6ebdc69d31eb2a11ac6479fa4f2e8c20f7d1
Closes-Bug: #1699115
|
|
|
|
|
|
|
| |
This suppresses a warning from SQLA which is only popping up in the
tests. Something we can and should avoid.
Change-Id: I3d1cf3a5dd817e0896809145fcb8fdd25a3a5d78
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The default used in code for CONF.notifications.default_publisher_id
is CONF.host, which is a free-form StrOpt.
In an upcoming change, the "my_ip" option is going to be changed from
a StrOpt to an IPOpt, so we made the default value change for
the default_publisher_id option before that.
Change-Id: Ia85130f66bd5a60097e8967064559fd0962d06fd
Closes-Bug: #1713150
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
In the nova notification code path the nova service / binary names
are hardcoded. There is a possible confusion as the REST API uses
'nova-osapi_compute' while the notifications use 'nova-api'
as the name of the nova compute service binary.
To avoid possible mixing of the names a new enum is introduced
in the notification code path with the valid values form
notification perspective.
Change-Id: Ia85a8b6c34a3efaf3ef509aab316294b9c0c2fd1
Closes-Bug: #1696152
|
|
|
|
|
|
|
|
|
|
| |
The publisher_id of the versioned instance.update notification contains
'conductor' as the source of the notification but every other versioned
notification use names like 'nova-compute', 'nova-api',
'nova-scheduler'. This patch fixes this inconsistency.
Change-Id: I61c1d1676e74e367b4aeef6a6d3a7bb2ffacee23
Closes-Bug: #1702667
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this patch notifications for instance
uses different format for datetime fields
This patch aligns that formating
Co-Authored-By: Timofey Durakov <tdurakov@mirantis.com>
Change-Id: I946a92601e4268bb224fc35b2052bca7436531f4
Closes-Bug: #1657428
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds notifications when instance
tags changed, as tag is commonly used for
searching and filtering, and projects like
searchlight depends on the notifications.
To avoid unnecessarily building a notification
payload when notifications are disabled, this
change also adds the if_notifications_enabled
decorator to send_instance_update_notification.
Change-Id: I03c8e8225e51fd80580772752c0b292987e34218
Implements: bp send-tag-notification
|
|
|
|
|
|
|
|
|
| |
The null_safe_ functions needs to be used from more than one payload
generator function therefore it needs to be moved to module level.
Also this patch adds missing test coverage to these functions.
Change-Id: Iedbb8db78793c963ef3039ff602e70e8c0aa4c0c
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This makes the notifications module use instance.flavor.$resource
instead of instance.$resource.
Change-Id: Ic31589aea0a2948179f6b3fb9cb759da4e2a2e78
|
|
|
|
|
| |
Change-Id: I4e1ca357322bdbcb95e4803001f4a7dc1bd37f04
Implements: bp versioned-notification-transformation-newton
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Replace 'stubs.Set' with 'stub_out' in the following files.
* nova/tests/unit/fake_notifier.py
Change-Id: Ie161780e748e3e8f1959a99d6d69e3518ccc958e
Implements: blueprint remove-mox-newton
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This cleans up a lot of cruft (and offenses) in tests around creating
instance objects with flavors.
Change-Id: Ibf8ccd5fe896a436649d11038948bd47cb304632
|
|
|
|
|
|
|
|
|
| |
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
|