Merge "Fixes typos in nova/db code"
This commit is contained in:
@@ -188,7 +188,7 @@ def compute_node_get_all(context, no_date_fields=False):
|
|||||||
|
|
||||||
:param context: The security context
|
:param context: The security context
|
||||||
:param no_date_fields: If set to True, excludes 'created_at', 'updated_at',
|
:param no_date_fields: If set to True, excludes 'created_at', 'updated_at',
|
||||||
'deteled_at' and 'deleted' fields from the output,
|
'deleted_at' and 'deleted' fields from the output,
|
||||||
thus significantly reducing its size.
|
thus significantly reducing its size.
|
||||||
Set to False by default
|
Set to False by default
|
||||||
|
|
||||||
@@ -483,7 +483,7 @@ def fixed_ip_disassociate_all_by_timeout(context, host, time):
|
|||||||
def fixed_ip_get(context, id, get_network=False):
|
def fixed_ip_get(context, id, get_network=False):
|
||||||
"""Get fixed ip by id or raise if it does not exist.
|
"""Get fixed ip by id or raise if it does not exist.
|
||||||
|
|
||||||
If get_network is true, also return the assocated network.
|
If get_network is true, also return the associated network.
|
||||||
"""
|
"""
|
||||||
return IMPL.fixed_ip_get(context, id, get_network)
|
return IMPL.fixed_ip_get(context, id, get_network)
|
||||||
|
|
||||||
|
|||||||
@@ -5635,7 +5635,7 @@ def instance_group_update(context, group_uuid, values):
|
|||||||
"""Update the attributes of an group.
|
"""Update the attributes of an group.
|
||||||
|
|
||||||
If values contains a metadata key, it updates the aggregate metadata
|
If values contains a metadata key, it updates the aggregate metadata
|
||||||
too. Similary for the policies and members.
|
too. Similarly for the policies and members.
|
||||||
"""
|
"""
|
||||||
session = get_session()
|
session = get_session()
|
||||||
with session.begin():
|
with session.begin():
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ def upgrade(migrate_engine):
|
|||||||
c_nodes = Table('compute_nodes', meta, autoload=True)
|
c_nodes = Table('compute_nodes', meta, autoload=True)
|
||||||
services = Table('services', meta, autoload=True)
|
services = Table('services', meta, autoload=True)
|
||||||
|
|
||||||
# set instances.node = compute_nodes.hypervisore_hostname
|
# set instances.node = compute_nodes.hypervisor_hostname
|
||||||
q = select(
|
q = select(
|
||||||
[instances.c.id, c_nodes.c.hypervisor_hostname],
|
[instances.c.id, c_nodes.c.hypervisor_hostname],
|
||||||
whereclause=and_(
|
whereclause=and_(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2012 Openstack Foundation
|
# Copyright 2012 OpenStack Foundation
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# 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
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
|||||||
@@ -56,6 +56,6 @@ def downgrade(migrate_engine):
|
|||||||
try:
|
try:
|
||||||
security_group_default_rules.drop()
|
security_group_default_rules.drop()
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = "Exception while droppping table 'security_group_default_rules'"
|
msg = "Exception while dropping table 'security_group_default_rules'"
|
||||||
LOG.exception(msg)
|
LOG.exception(msg)
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ def _upgrade_bdm_v2(meta, bdm_table, bdm_shadow_table):
|
|||||||
# with boot index, as we don't support it yet.
|
# with boot index, as we don't support it yet.
|
||||||
# Also, make sure that instances started with
|
# Also, make sure that instances started with
|
||||||
# the old syntax of specifying an image *and*
|
# the old syntax of specifying an image *and*
|
||||||
# a bootable volume still have consistend data.
|
# a bootable volume still have consistent data.
|
||||||
bootable = ((strip_dev(device_name) ==
|
bootable = ((strip_dev(device_name) ==
|
||||||
strip_dev(instance_root_device))
|
strip_dev(instance_root_device))
|
||||||
and bdm_v2['source_type'] != 'blank')
|
and bdm_v2['source_type'] != 'blank')
|
||||||
|
|||||||
@@ -738,7 +738,7 @@ class Migration(BASE, NovaBase):
|
|||||||
# NOTE(tr3buchet): the ____compute variables are instance['host']
|
# NOTE(tr3buchet): the ____compute variables are instance['host']
|
||||||
source_compute = Column(String(255))
|
source_compute = Column(String(255))
|
||||||
dest_compute = Column(String(255))
|
dest_compute = Column(String(255))
|
||||||
# nodes are equivalent to a compute node's 'hypvervisor_hostname'
|
# nodes are equivalent to a compute node's 'hypervisor_hostname'
|
||||||
source_node = Column(String(255))
|
source_node = Column(String(255))
|
||||||
dest_node = Column(String(255))
|
dest_node = Column(String(255))
|
||||||
# NOTE(tr3buchet): dest_host, btw, is an ip address
|
# NOTE(tr3buchet): dest_host, btw, is an ip address
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ def drop_unique_constraint(migrate_engine, table_name, uc_name, *columns,
|
|||||||
**col_name_col_instance):
|
**col_name_col_instance):
|
||||||
"""
|
"""
|
||||||
This method drops UC from table and works for mysql, postgresql and sqlite.
|
This method drops UC from table and works for mysql, postgresql and sqlite.
|
||||||
In mysql and postgresql we are able to use "alter table" constuction. In
|
In mysql and postgresql we are able to use "alter table" construction. In
|
||||||
sqlite is only one way to drop UC:
|
sqlite is only one way to drop UC:
|
||||||
1) Create new table with same columns, indexes and constraints
|
1) Create new table with same columns, indexes and constraints
|
||||||
(except one that we want to drop).
|
(except one that we want to drop).
|
||||||
@@ -178,9 +178,9 @@ def drop_unique_constraint(migrate_engine, table_name, uc_name, *columns,
|
|||||||
4) Rename new table to the name of old table.
|
4) Rename new table to the name of old table.
|
||||||
|
|
||||||
:param migrate_engine: sqlalchemy engine
|
:param migrate_engine: sqlalchemy engine
|
||||||
:param table_name: name of table that contains uniq constarint.
|
:param table_name: name of table that contains uniq constraint.
|
||||||
:param uc_name: name of uniq constraint that will be dropped.
|
:param uc_name: name of uniq constraint that will be dropped.
|
||||||
:param columns: columns that are in uniq constarint.
|
:param columns: columns that are in uniq constraint.
|
||||||
:param col_name_col_instance: contains pair column_name=column_instance.
|
:param col_name_col_instance: contains pair column_name=column_instance.
|
||||||
column_instance is instance of Column. These params
|
column_instance is instance of Column. These params
|
||||||
are required only for columns that have unsupported
|
are required only for columns that have unsupported
|
||||||
|
|||||||
Reference in New Issue
Block a user