summaryrefslogtreecommitdiff
path: root/nova/objects/instance_fault.py
Commit message (Collapse)AuthorAgeFilesLines
* db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api'Stephen Finucane2021-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Merge these, removing an unnecessary layer of abstraction, and place them in the new 'nova.db.main' directory. The resulting change is huge, but it's mainly the result of 's/sqlalchemy import api/main import api/' and 's/nova.db.api/nova.db.main.api/' with some necessary cleanup. We also need to rework how we do the blocking of API calls since we no longer have a 'DBAPI' object that we can monkey patch as we were doing before. This is now done via a global variable that is set by the 'main' function of 'nova.cmd.compute'. The main impact of this change is that it's no longer possible to set '[database] use_db_reconnect' and have all APIs automatically wrapped in a DB retry. Seeing as this behavior is experimental, isn't applied to any of the API DB methods (which don't use oslo.db's 'DBAPI' helper), and is used explicitly in what would appear to be the critical cases (via the explicit 'oslo_db.api.wrap_db_retry' decorator), this doesn't seem like a huge loss. Change-Id: Iad2e4da4546b80a016e477577d23accb2606a6e4 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
* Remove 'instance_fault_create_at_top'Stephen Finucane2019-04-291-12/+0
| | | | | | | | | | | | This was being called within the 'InstanceFault' object. Remove it in its entirety, given that nothing should be calling it now. As with the removal of the 'bdm_(update_or_create|destroy)_at_top' APIs, this breaks part of cells v1 but we don't really care. Part of blueprint remove-cells-v1 Change-Id: Ia7b0166fce8c9ad5baa2a9ed6df8169f898522f2 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Use nova.db.api directlyChris Dent2018-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | nova/db/__init__.py was importing * from nova.db.api. This meant that any time any code anywhere within the nova.db package was imported then nova.db.api was too, leading to a cascade of imports that may not have been desired. Also, in general, code in __init__.py is a pain. Therefore, this change adjusts code that so that either: * nova.db.api is used directly * nova.db.api is imported as 'db' In either case, the functionality remains the same. The primary goal of this change was to make it possible to import the model files without having to import the db api. Moving the model files to a different place in the directory hierarchy was considered, but given that "code in __init__.py is a pain" this mode was chosen. This looks like a very large change, but it is essentially adjusting package names, many in mocks. Change-Id: Ic1fd7c87ceda05eeb96735da2a415ef37060bb1a
* Remove translation of log messagesNgo Quoc Cuong2017-06-211-2/+1
| | | | | | | | | | | The i18n team has decided not to translate the logs because it seems like it not very useful; operators prefer to have them in English so that they can search for those strings on the internet. Partially fix on nova/keymgr, nova/network, nova/notifications, nova/objects and nova/pci other paths will be fixed on next commits Change-Id: Ie3a83fef0dc689b9d37ac43e047ce5d48f567adc
* Only return latest instance fault for instancesJay Pipes2016-12-141-1/+11
| | | | | | | | | | | | | | | | | | | | | | This patch addresses slowness that can occur when doing a list servers API operation when there are many thousands of records in the instance_faults table. Previously, in the Instance.fill_faults() method, we were getting all instance fault records for a set of instances having one of a set of supplied instance UUIDs and then iterating over those faults and returning a dict of instance UUID to the first fault returned (which happened to be the latest fault because of ordering the SQL query by created_at). This patch adds a new InstanceFaultList.get_latest_by_instance_uuids() method that does some SQL-fu to only return the latest fault records for each instance being inspected. Closes-Bug: #1632247 Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com> Change-Id: I8f2227b3969791ebb2d04d74a316b9d97a4b1571
* Remove obj_relationships from objectsDan Smith2015-10-301-4/+0
| | | | | | | | | | | | | | In Liberty, we converted to using the manifest-based class action and backport methods, which no longer rely on these object relationship maps. They provide a full manifest of client-side versions with each call, which is far more robust than us trying to hand-edit these mappings (which we get incorrect a lot). Since we're now in Mitaka, we can drop compatibility with clients that don't make the version-manifest calls. Those have also been deprecated in oslo.versionedobjects. Change-Id: Iea8b6348e3b01aaa335ec5408f07826f1e758d20
* Change List objects to use obj_relationshipsRyan Rossiter2015-07-311-4/+3
| | | | | | | | | | | List objects used to use child_versions, which was tested in a more shallow way than test_relationships() tests obj_relationships. This change moves over all list classes to use obj_relationships (and therefore are now tested in test_relationships() with all other objects). Change-Id: I334dba243de45bf11ccb5ab55e2aa8390fe9d8c2 Closes-Bug: #1470154
* Begin the transition to an explicit object registryDan Smith2015-06-081-0/+2
| | | | | | | | | | | In oslo.versionedobjects, the registry is opt-in instead of implicit. This patch sets the stage for moving to that by defining a no-op registry with a compatible register method so that we can go ahead and decorate the object classes and then move the registry underneath them. Related to blueprint use-oslo-objects Change-Id: Iddc68a2d8a9b103621bc60a7426fe495edf80aad
* Remove context from remotable call signatureDan Smith2015-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is the final step in removing the context parameter from the signature of a remotable method. This includes a change of most of the object hashes, without version bumps. That's because the hashing algorithm is just looking for changes in things like a call signature, in order to signal that a version bump is required. Since context is in the signature, removing it triggers the alert. However, context is not _actually_ part of the on-the-wire API, as it is stripped out on the caller side, and re-added on the callee side (hence why we're making this change in the first place). If the test had been uuber-pedantic to exclude context from consideration, then the hashes would not be changing here, but alas. In short, the hash changes are false alarms and do not mean we need version bumps for all the things. Related to blueprint kilo-objects Change-Id: I89464c0ab7e6e0d84e677b9a69a86468727b6438
* Remove usage of remotable context parameter in instance* objectsDan Smith2015-03-171-3/+3
| | | | | | | | | | | | This removes the use of the context parameter in remotable methods in these objects. This is a precursor to actually removing the context from the call, but we need to remove dependence on the argument first. Remotable methods should be using the bundled object context. Related to blueprint kilo-objects Change-Id: If89e6e03d1e15f8ce688166ff2faa4794280c112
* Use oslo.logDavanum Srinivas2015-02-221-1/+2
| | | | | | | | | | Convert the use of the incubated version of the log module to the new oslo.log library. Sync oslo-incubator modules to update their imports as well. Co-Authored-By: Doug Hellmann <doug@doughellmann.com> Change-Id: Ic4932e3f58191869c30bd07a010a6e9fdcb2a12c
* objects: remove dict compat support from all XXXList() objectsDaniel P. Berrange2014-12-121-3/+1
| | | | | | | | | The XXXList() classes only ever have a single 'objects' attribute and this is never directly accessed as a dict key, instead all callers use it in list context. Thus the dict compat support can be removed from all these objects Change-Id: I3f8d49d25b99dd0a498dfaad705c6332908cb72f
* objects: allow creation of objects without dict item compatDaniel P. Berrange2014-12-121-2/+6
| | | | | | | | | | | | | | | | | | | The dict compat support in NovaObject is useful for incrementally converting existing code over to use objects. Any brand new objects though have no reason to support dictionary access, so there should be a way to disable this compat mode. This moves all the dict compat support methods out of NovaObject, to a new class NovaObjectDictCompat. All existing objects are updated to add this new class as a mix-in parent. In future any completely new objects (ie ones which aren't being used to converted existing code from dict instances) should avoid inheriting from NovaObjectDictCompat. Existing objects should also have this parent class removed once all callers are audited and/or updated to ensure they do not require dict compat. Change-Id: I03f93f0c40df6f5f7df9cefe28dff900c22294c9
* Use oslo.i18nDavanum Srinivas2014-07-181-1/+1
| | | | | | | | oslo.i18n provides the i18n functions that were provided by oslo-incubator's gettextutils module. Some tests that were using internal details of the library were removed. Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
* Fix object code direct use of other object modulesChris Behrens2014-06-241-1/+2
| | | | | | | | | | | | | | | The object code itself should not explicitly reference its own objects, as objects could be subclassed. Also: There were a few objects that had their own __init__()s that didn't support accepting 'context' or kwargs. At some point here, we should also require that context is passed when instantiating the objects. So, I added the (currently optional) context argument on some object instantiations near the places I was touching. Partial-Blueprint: object-subclassing Change-Id: Icf631c770e347b4bb32999c4ba2431d1db49e11c
* Make cells use Fault obj for createChris Behrens2014-05-021-0/+17
| | | | | | | | | | | Add support into InstanceFault.create() to handle where we need to duplicate any faults in the API cells. Convert the cells code to use InstanceFault.create() NOTE: This happens to fix an oversight where we accidentally left the update_cells=False kwarg off of the db call in the cells code. Change-Id: Iec11b8259aaecba055a6d5636ab60dfa0dbb6c83
* Add create() method to InstanceFault objectDan Smith2014-05-021-2/+22
| | | | | | | | This allows creating InstanceFaults through the object interface. Related to blueprint virt-objects-juno Change-Id: Iedde2e220127778fa6252d310f9e73c8506f605e
* Clean up _make_*_list in object models to use base.obj_make_listShane Wang2014-02-261-15/+11
| | | | | | | | | | | | | | There are a lot of places where _make_foo_list()s are implemented. Actually base.obj_make_list() can be used to make the list. The patch is to clean up the redundancies and make the code clean. Also, in order to make _from_db_objects()s the same format, we add 'context' into the parameter list in instance fault object. Related to blueprint icehouse-objects. Change-Id: I1a68b6e9dc402d4e30a06f94b068233e2afa713f
* Require List objects to be able to backlevel their contentsDan Smith2013-12-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Right now, a client declares its supported version of a given object automatically in the remoted calls it makes to conductor. However, in the case of things like InstanceList.get_by_foo(), they are reporting the version of their InstanceList object, not their Instance object. Conductor fills a version-matching InstanceList object with brand new Instance objects, which the client, of course, barfs on. There may be a better way to handle this going forward, but for now, stop the bleeding by requiring a version bump to the corresponding List object whenever the object type it contains takes a version bump. This adds a test to validate that all the objects registered have a suitable mapping for the current version in the tree. Since this actually caused a breakage in the Instance object recently, this also bumps the InstanceList version so that conductors running this commit (or later) will properly send version 1.9 Instance objects to Havana clients and version 1.10+ to newer ones. Change-Id: I2668dead4784fbd0411d1b6372a9a8006eeb2e84 Related-Bug: #1258256 Closes-Bug: #1254902
* Make Object FieldType take an object name instead of a classDan Smith2013-10-211-0/+4
| | | | | | | | | | | | | The object infrastructure has a concept of an object name, which is what we use to determine if something implements a particular thing, and it is how we look up object classes when we deserialize them. Since many objects will eventually reference each other, we should be using their names to determine compatibility, not their classes. Related to blueprint structured-object-fields Change-Id: I2edb8b8475662ad25e9f3319ce5e44317a2d0547
* Migrate InstanceFault object to FieldsDan Smith2013-10-111-7/+7
| | | | | | Related to blueprint structured-object-fields Change-Id: I832f4af2e517ebbc28ace32a78730dbd3f87fb45
* Fix non-unicode string values on objectsDan Smith2013-09-171-1/+5
| | | | | | | | | | | Originally, all of the objects used str() to specify string type attributes. This prevents the use of unicode values. A previous patch errantly updated the utility function without bumping all of the affected objects' versions. This does that, and also fixes the issue for bare str() attributes. Change-Id: Iad83589d399309b95c32813a1a660a12e571066b Closes-bug: 1221346
* Create mixin class for common DB fieldsChris Behrens2013-09-041-1/+1
| | | | | | | | | | Creates a new DBObjectMixin class for DB-backed objects to use. This allows us to create non-DB-backed objects without having the common DB fields automagically added to them. Related to blueprint unified-object-model Change-Id: Iaf2d8500505e9acdbffffb1d4bd3db0870ae82a3
* Add basic InstanceFault modelDan Smith2013-06-261-0/+61
This adds a basic InstanceFault model, list, and tests. Related to blueprint unified-objet-model Change-Id: I9226bc1f6e21d298b6d5d8694d336d38e471846d