nova/nova/tests/unit/objects
Dan Smith 001f3a7bfe Fix instance.hidden migration and querying
It was discovered that default= on a Column definition in a schema migration
will attempt to update the table with the provided value, instead of just
translating on read, which is often the assumption. The Instance.hidden=False
change introduced in Train[1] used such a default on the new column, which caused
at least one real-world deployment to time out rewriting the instances table
due to size. Apparently SQLAlchemy-migrate also does not consider such a timeout
to be a failure and proceeds on. The end result is that some existing instances
in the database have hidden=NULL values, and the DB model layer does not convert
those to hidden=False when we read/query them, causing those instances to be
excluded from the API list view.

This change alters the 399 schema migration to remove the default=False
specification. This does not actually change the schema, but /will/ prevent
users who have not yet upgraded to Train from rewriting the table.

This change also makes the instance_get_all_by_filters() code handle hidden
specially, including false and NULL in a query for non-hidden instances.

A future change should add a developer trap test to ensure that future migrations
do not add default= values to new columns to avoid this situation in the future.

[1] Iaffb27bd8c562ba120047c04bb62619c0864f594

Change-Id: Iace3f653b42c20887b40ee0105c8e9a4edeff1f7
Closes-Bug: #1862205
2020-02-07 08:54:56 -08:00
..
__init__.py
test_agent.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_aggregate.py DB API changes to get non-matching aggregates from metadata 2019-09-12 16:56:32 -05:00
test_bandwidth_usage.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_block_device.py Remove 'bdm_(update_or_create|destroy)_at_top' 2019-04-16 18:26:17 +01:00
test_build_request.py Merge "Fix misuse of nova.objects.base.obj_equal_prims" 2019-08-13 22:08:39 +00:00
test_cell_mapping.py Fix formatting non-templated cell URLs with no config 2018-10-16 16:11:17 -04:00
test_compute_node.py objects: Add 'NUMACell.pcpuset' field 2019-09-18 00:21:10 +01:00
test_console_auth_token.py Reduce scope of 'path' query parameter to noVNC consoles 2019-09-27 13:50:52 +00:00
test_diagnostics.py Added nova objects for intance diagnostics 2017-05-30 00:39:44 +04:00
test_ec2.py ec2: Move ec2utils functions to their callers 2019-09-27 15:27:08 +01:00
test_external_event.py Use EnumField for instance external event name 2015-05-20 22:16:52 +00:00
test_fields.py Switch to using os-resource-classes 2019-02-07 11:11:09 +00:00
test_fixed_ip.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_flavor.py Fix all invalid obj_make_compatible test case 2018-07-27 02:20:46 +00:00
test_floating_ip.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_host_mapping.py Warn for duplicate host mappings during discover_hosts 2019-06-13 17:18:16 +00:00
test_hv_spec.py objects: Move 'vm_mode' to 'fields.VMMode' 2016-11-25 16:19:44 +00:00
test_image_meta.py Libvirt: add support for vPMU configuration. 2019-08-20 14:41:57 +00:00
test_instance.py Fix instance.hidden migration and querying 2020-02-07 08:54:56 -08:00
test_instance_action.py Add InstanceAction/Event create() method 2019-08-07 17:56:01 -04:00
test_instance_device_metadata.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_instance_fault.py Remove 'instance_fault_create_at_top' 2019-04-29 17:54:17 +01:00
test_instance_group.py Avoid unnecessary joins in InstanceGroup.get_hosts 2019-05-23 11:14:55 -04:00
test_instance_info_cache.py Remove 'instance_info_cache_update_at_top' 2019-04-29 17:55:41 +01:00
test_instance_mapping.py Add user_id field to InstanceMapping 2019-03-08 19:01:16 -05:00
test_instance_numa.py Add NovaEphemeralObject class for non-persistent objects 2020-01-14 08:13:18 -08:00
test_instance_pci_requests.py [FUP] Follow-up patch for SR-IOV live migration 2019-07-02 13:52:01 -05:00
test_keypair.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_migrate_data.py New objects for NUMA live migration 2019-09-12 17:34:34 -04:00
test_migration.py Join migration_context and flavor in Migration.instance 2019-10-21 13:00:59 -04:00
test_migration_context.py Fix accumulated non-docs nits for cross-cell-resize series 2019-12-23 10:10:57 -05:00
test_monitor_metric.py Fix MonitorMetric obj_make_compatible 2016-09-12 14:10:41 +00:00
test_network.py Fix ovo compatibility code unit tests 2019-01-16 15:51:22 +01:00
test_network_request.py nova-net: Remove final references to nova-network 2020-01-08 13:54:12 +00:00
test_numa.py hardware: Differentiate between shared and dedicated CPUs 2019-09-18 00:21:10 +01:00
test_objects.py Merge "Add NovaEphemeralObject class for non-persistent objects" 2020-01-19 23:18:59 +00:00
test_pci_device.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_pci_device_pool.py Return empty PciDevicePoolList obj instead of None 2015-09-11 21:20:01 +02:00
test_quotas.py nova-net: Remove 'networks' quota 2019-11-22 16:49:31 +00:00
test_request_spec.py Use Placement 1.35 (root_required) 2020-01-07 16:46:56 -06:00
test_resource.py libvirt: Enable driver discovering PMEM namespaces 2019-09-13 08:50:35 +00:00
test_security_group.py Fix ovo compatibility code unit tests 2019-01-16 15:51:22 +01:00
test_security_group_rule.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_selection.py Add Selection.availability_zone field 2019-10-02 13:39:24 -04:00
test_service.py Remove service_uuids_online_data_migration 2019-11-08 11:38:48 -05:00
test_tag.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_task_log.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_trusted_certs.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_vcpu_model.py objects: Move 'cpumodel' to 'fields.CPU*' 2016-11-25 16:19:43 +00:00
test_virt_cpu_topology.py
test_virtual_interface.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_volume_usage.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00