Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an integer that defaults to zero. This can be used by API services to efficiently filter out records that have already been mapped by a HostMapping. This is an integer instead of a boolean in case we later need to do some other sort of mapping of these records and need to distinguish yet another level of mapped-ness. Note this also removes some tests from TestNewtonBlocker which can no longer work with the new ComputeNode model since they attempt to use it to create compute nodes at a schema older than needed for this new field. The point of the test was to verify, in Newton, that the blocker migration caught the thing we needed to catch. It doesn't need to be in master anymore and certainly is not worth the acrobatics that would be required to keep it working. (Note that we haven't even had such tests for many of our blocker migrations) Related to blueprint discover-hosts-faster Change-Id: I902d75efb0bbe177680d7211c23235f42497e3fe
- Loading branch information
Showing
9 changed files
with
55 additions
and
50 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
nova/db/sqlalchemy/migrate_repo/versions/360_add_compute_node_mapped.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2017 Red Hat, Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from sqlalchemy import MetaData, Table, Column, Integer | ||
|
||
|
||
def upgrade(migrate_engine): | ||
meta = MetaData(bind=migrate_engine) | ||
|
||
for prefix in ('', 'shadow_'): | ||
compute_nodes = Table('%scompute_nodes' % prefix, meta, autoload=True) | ||
mapped = Column('mapped', Integer, default=0, nullable=True) | ||
if not hasattr(compute_nodes.c, 'mapped'): | ||
compute_nodes.create_column(mapped) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters