From a0360f97191035d96a4e0e4d3cabd3bb6bb3549a Mon Sep 17 00:00:00 2001 From: Tom Weininger Date: Mon, 15 Jan 2024 12:55:27 +0100 Subject: [PATCH] pyupgrade changes for Python3.8+ (5) Result of running $ pyupgrade --py38-plus $(git ls-files | grep ".py$") This was inspired by Nova [1] Fixed PEP8 errors introduced by pyupgrade by running: $ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \ --in-place octavia and manual updates. [1]: https://review.opendev.org/c/openstack/nova/+/896986 Change-Id: I9aeb3d603a519c3029b5be1ab622a0250f628f7d --- octavia/db/base_models.py | 10 +- .../034756a182a2_amphora_add_image_id.py | 4 +- .../034b2dc2f3e0_modernize_l7policy_fields.py | 62 +-- .../0f242cf02c74_add_provider_column.py | 4 +- .../10d38216ad34_add_timestamps_to_amphora.py | 8 +- .../versions/11e4bb2bb8ef_fix_ipv6_vip.py | 2 +- .../13500e2e978d_update_url_and_name_size.py | 12 +- .../versions/14892634e228_update_vip.py | 10 +- ...b9b_add_server_group_id_to_loadbalancer.py | 4 +- ...1afc932f1ca2_l7rule_support_client_cert.py | 6 +- ...044c_keepalived_configuration_datamodel.py | 52 +-- ..._adding_terminate_https_tls_ref_support.py | 8 +- ...6852d5ff7c_add_lb_network_ip_to_amphora.py | 4 +- ..._add_monitor_address_and_port_to_member.py | 8 +- ...add_amphora_vrrp_port_id_and_ha_port_id.py | 8 +- .../versions/29ff921a6eb_shared_pools.py | 2 +- ...add_listener_client_ca_tls_certificate_.py | 4 +- ...67_allow_multiple_vips_per_loadbalancer.py | 20 +- ...5c35b26a8_add_l7policy_and_l7rule_quota.py | 8 +- ...c_update_lb_and_amphora_data_model_for_.py | 40 +- .../versions/35dee79d5865_initial_create.py | 370 +++++++++--------- .../versions/36b94648fef8_add_timestamp.py | 4 +- ...b85b4419_add_primary_key_to_spares_pool.py | 2 +- .../3a1e1cdb7b27_rename_amphora_host_id.py | 2 +- ...a0bdb9_add_vrrp_ip_and_ha_ip_to_amphora.py | 8 +- .../3f8ff3be828e_create_quotas_table.py | 24 +- ...87cd10fef_make_pool_lb_algorithm_larger.py | 12 +- .../443fe6676637_add_network_id_to_vip.py | 4 +- ...dding_name_column_to_member_and_health_.py | 2 +- .../458c9ee2a011_l7_policies_and_rules.py | 112 +++--- ...46d914b2a5e5_seed_the_spares_pool_table.py | 4 +- ...48660b6643f0_add_new_states_for_amphora.py | 6 +- ...094013699a_update_load_balancer_amphora.py | 18 +- .../4f65b4f91c39_amphora_add_flavor_id.py | 4 +- ...aaa983e7a9_update_member_address_column.py | 2 +- .../4fe8240425b4_update_vip_add_subnet_id.py | 4 +- ...704420e_add_timestamps_to_healthmonitor.py | 18 +- ...309960964f8_add_proxy_protocol_for_pool.py | 6 +- ...d_a_column_busy_in_table_amphora_health.py | 4 +- ...ed6_add_l7policy_action_redirect_prefix.py | 10 +- ...cert_expiration__infor_in_amphora_table.py | 8 +- ...2816c232310_fix_migration_for_mysql_5_7.py | 2 +- ...a1b27c2_add_l7policy_redirect_http_code.py | 4 +- ...d7fc21_add_prometheus_listener_protocol.py | 6 +- .../6ffc710674ef_spares_pool_table.py | 4 +- ..._host_head_inject_for_http_health_check.py | 8 +- ...694c_extend_pool_for_backend_ca_and_crl.py | 8 +- ...6aacf2e176c_extend_support_udp_protocol.py | 6 +- .../versions/80dba23a159f_tags_support.py | 6 +- .../82b9402e71fd_update_vip_address_size.py | 2 +- ...ac4ed24df3a_add_availability_zone_to_lb.py | 8 +- .../versions/8b47b2546312_sctp_support.py | 4 +- ..._change_tls_container_id_length_in_sni_.py | 2 +- .../92fe9857279_create_healthmanager_table.py | 6 +- ...6d6d_add_provisioning_status_to_objects.py | 20 +- ...d_pool_for_support_backend_reencryption.py | 4 +- ...f_add_tls_boolean_type_for_reencryption.py | 4 +- ...314_add_flavor_and_flavor_profile_table.py | 36 +- ...ba35e0fb88e1_add_backup_field_to_member.py | 4 +- .../bf171d0d91c3_amphora_add_cached_zone.py | 4 +- ...761c8a71579_add_availability_zone_table.py | 30 +- .../versions/d85ca7258d21_modernize_l7rule.py | 26 +- ...da371b422669_allowed_cidr_for_listeners.py | 14 +- ...e59aae4_add_lb_algorithm_source_ip_port.py | 4 +- .../e37941b010db_add_lb_flavor_constraint.py | 22 +- ...3bf_add_ping_and_tlshello_monitor_types.py | 6 +- ...e6ee84f0abf3_add_proxy_v2_pool_protocol.py | 6 +- ...5e_add_octavia_owned_vip_column_to_vip_.py | 4 +- .../f21ae3f21adc_add_client_auth_option.py | 12 +- ..._create_amphora_build_rate_limit_tables.py | 22 +- ...98c1_add_certificate_revoke_list_option.py | 4 +- octavia/db/models.py | 2 +- octavia/db/repositories.py | 6 +- 73 files changed, 598 insertions(+), 598 deletions(-) diff --git a/octavia/db/base_models.py b/octavia/db/base_models.py index 6185e8446c..133a7df45d 100644 --- a/octavia/db/base_models.py +++ b/octavia/db/base_models.py @@ -143,29 +143,29 @@ class OctaviaBase(models.ModelBase): return f"{self.__class__.__name__}({params})" -class LookupTableMixin(object): +class LookupTableMixin: """Mixin to add to classes that are lookup tables.""" name = sa.Column(sa.String(255), primary_key=True, nullable=False) description = sa.Column(sa.String(255), nullable=True) -class IdMixin(object): +class IdMixin: """Id mixin, add to subclasses that have an id.""" id = sa.Column(sa.String(36), primary_key=True, default=uuidutils.generate_uuid) -class ProjectMixin(object): +class ProjectMixin: """Tenant mixin, add to subclasses that have a project.""" project_id = sa.Column(sa.String(36)) -class NameMixin(object): +class NameMixin: """Name mixin to add to classes which need a name.""" name = sa.Column(sa.String(255), nullable=True) -class TagMixin(object): +class TagMixin: """Tags mixin to add to classes which need tags. The class must realize the specified db relationship as well. diff --git a/octavia/db/migration/alembic_migrations/versions/034756a182a2_amphora_add_image_id.py b/octavia/db/migration/alembic_migrations/versions/034756a182a2_amphora_add_image_id.py index 745132ff92..e3a61cbd9b 100644 --- a/octavia/db/migration/alembic_migrations/versions/034756a182a2_amphora_add_image_id.py +++ b/octavia/db/migration/alembic_migrations/versions/034756a182a2_amphora_add_image_id.py @@ -30,6 +30,6 @@ down_revision = '10d38216ad34' def upgrade(): op.add_column( - u'amphora', - sa.Column(u'image_id', sa.String(36), nullable=True) + 'amphora', + sa.Column('image_id', sa.String(36), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/034b2dc2f3e0_modernize_l7policy_fields.py b/octavia/db/migration/alembic_migrations/versions/034b2dc2f3e0_modernize_l7policy_fields.py index 545c4cae0a..b00ad108ef 100644 --- a/octavia/db/migration/alembic_migrations/versions/034b2dc2f3e0_modernize_l7policy_fields.py +++ b/octavia/db/migration/alembic_migrations/versions/034b2dc2f3e0_modernize_l7policy_fields.py @@ -33,33 +33,33 @@ down_revision = 'fac584114642' def upgrade(): # Add timing data op.add_column( - u'l7policy', - sa.Column(u'created_at', sa.DateTime(), nullable=True) + 'l7policy', + sa.Column('created_at', sa.DateTime(), nullable=True) ) op.add_column( - u'l7policy', - sa.Column(u'updated_at', sa.DateTime(), nullable=True) + 'l7policy', + sa.Column('updated_at', sa.DateTime(), nullable=True) ) # Add project_id op.add_column( - u'l7policy', - sa.Column(u'project_id', sa.String(36), nullable=True) + 'l7policy', + sa.Column('project_id', sa.String(36), nullable=True) ) # Add new operating_status column, setting existing rows to ONLINE op.add_column( - u'l7policy', - sa.Column(u'operating_status', sa.String(16), + 'l7policy', + sa.Column('operating_status', sa.String(16), nullable=False, server_default=constants.ONLINE) ) # Remove the default, as we don't actually want one - op.alter_column(u'l7policy', u'operating_status', + op.alter_column('l7policy', 'operating_status', existing_type=sa.String(16), server_default=None) # Add the foreign key for operating_status_name op.create_foreign_key( - u'fk_l7policy_operating_status_name', u'l7policy', - u'operating_status', [u'operating_status'], [u'name'] + 'fk_l7policy_operating_status_name', 'l7policy', + 'operating_status', ['operating_status'], ['name'] ) op.drop_constraint('fk_health_monitor_provisioning_status_name', @@ -83,59 +83,59 @@ def upgrade(): type_='foreignkey') # provisioning_status was mistakenly added as nullable, the fix is similar - op.alter_column(u'l7policy', u'provisioning_status', nullable=False, + op.alter_column('l7policy', 'provisioning_status', nullable=False, existing_type=sa.String(16), server_default=constants.ACTIVE) - op.alter_column(u'l7policy', u'provisioning_status', + op.alter_column('l7policy', 'provisioning_status', existing_type=sa.String(16), server_default=None) # Fix the rest of these that were also mistakenly set as nullable in: # 9b5473976d6d_add_provisioning_status_to_objects.py - op.alter_column(u'health_monitor', u'provisioning_status', nullable=False, + op.alter_column('health_monitor', 'provisioning_status', nullable=False, existing_type=sa.String(16), server_default=constants.ACTIVE) - op.alter_column(u'health_monitor', u'provisioning_status', + op.alter_column('health_monitor', 'provisioning_status', existing_type=sa.String(16), server_default=None) - op.alter_column(u'member', u'provisioning_status', nullable=False, + op.alter_column('member', 'provisioning_status', nullable=False, existing_type=sa.String(16), server_default=constants.ACTIVE) - op.alter_column(u'member', u'provisioning_status', + op.alter_column('member', 'provisioning_status', existing_type=sa.String(16), server_default=None) - op.alter_column(u'pool', u'provisioning_status', nullable=False, + op.alter_column('pool', 'provisioning_status', nullable=False, existing_type=sa.String(16), server_default=constants.ACTIVE) - op.alter_column(u'pool', u'provisioning_status', + op.alter_column('pool', 'provisioning_status', existing_type=sa.String(16), server_default=None) - op.alter_column(u'l7rule', u'provisioning_status', nullable=False, + op.alter_column('l7rule', 'provisioning_status', nullable=False, existing_type=sa.String(16), server_default=constants.ACTIVE) - op.alter_column(u'l7rule', u'provisioning_status', + op.alter_column('l7rule', 'provisioning_status', existing_type=sa.String(16), server_default=None) op.create_foreign_key( - u'fk_health_monitor_provisioning_status_name', u'health_monitor', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_health_monitor_provisioning_status_name', 'health_monitor', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.create_foreign_key( - u'fk_l7policy_provisioning_status_name', u'l7policy', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_l7policy_provisioning_status_name', 'l7policy', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.create_foreign_key( - u'fk_l7rule_provisioning_status_name', u'l7rule', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_l7rule_provisioning_status_name', 'l7rule', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.create_foreign_key( - u'fk_member_provisioning_status_name', u'member', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_member_provisioning_status_name', 'member', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.create_foreign_key( - u'fk_pool_provisioning_status_name', u'pool', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_pool_provisioning_status_name', 'pool', + 'provisioning_status', ['provisioning_status'], ['name'] ) diff --git a/octavia/db/migration/alembic_migrations/versions/0f242cf02c74_add_provider_column.py b/octavia/db/migration/alembic_migrations/versions/0f242cf02c74_add_provider_column.py index cbd5f63fbf..3af37c325d 100644 --- a/octavia/db/migration/alembic_migrations/versions/0f242cf02c74_add_provider_column.py +++ b/octavia/db/migration/alembic_migrations/versions/0f242cf02c74_add_provider_column.py @@ -30,8 +30,8 @@ down_revision = '0fd2c131923f' def upgrade(): op.add_column( - u'load_balancer', - sa.Column(u'provider', sa.String(64), nullable=True) + 'load_balancer', + sa.Column('provider', sa.String(64), nullable=True) ) op.execute("UPDATE load_balancer set provider='amphora' where provider " "is null") diff --git a/octavia/db/migration/alembic_migrations/versions/10d38216ad34_add_timestamps_to_amphora.py b/octavia/db/migration/alembic_migrations/versions/10d38216ad34_add_timestamps_to_amphora.py index 8ca76b8d25..797529c6c5 100644 --- a/octavia/db/migration/alembic_migrations/versions/10d38216ad34_add_timestamps_to_amphora.py +++ b/octavia/db/migration/alembic_migrations/versions/10d38216ad34_add_timestamps_to_amphora.py @@ -30,10 +30,10 @@ down_revision = '0aee2b450512' def upgrade(): op.add_column( - u'amphora', - sa.Column(u'created_at', sa.DateTime(), nullable=True) + 'amphora', + sa.Column('created_at', sa.DateTime(), nullable=True) ) op.add_column( - u'amphora', - sa.Column(u'updated_at', sa.DateTime(), nullable=True) + 'amphora', + sa.Column('updated_at', sa.DateTime(), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/11e4bb2bb8ef_fix_ipv6_vip.py b/octavia/db/migration/alembic_migrations/versions/11e4bb2bb8ef_fix_ipv6_vip.py index 2a87d0a821..63e09832ef 100644 --- a/octavia/db/migration/alembic_migrations/versions/11e4bb2bb8ef_fix_ipv6_vip.py +++ b/octavia/db/migration/alembic_migrations/versions/11e4bb2bb8ef_fix_ipv6_vip.py @@ -27,4 +27,4 @@ down_revision = '211982b05afc' def upgrade(): - op.alter_column(u'vip', u'ip_address', type_=sa.String(64)) + op.alter_column('vip', 'ip_address', type_=sa.String(64)) diff --git a/octavia/db/migration/alembic_migrations/versions/13500e2e978d_update_url_and_name_size.py b/octavia/db/migration/alembic_migrations/versions/13500e2e978d_update_url_and_name_size.py index 5686305475..a8f3c4ad00 100644 --- a/octavia/db/migration/alembic_migrations/versions/13500e2e978d_update_url_and_name_size.py +++ b/octavia/db/migration/alembic_migrations/versions/13500e2e978d_update_url_and_name_size.py @@ -29,15 +29,15 @@ down_revision = '4c094013699a' def upgrade(): - op.alter_column(u'provisioning_status', u'name', + op.alter_column('provisioning_status', 'name', existing_type=sa.String(255)) - op.alter_column(u'operating_status', u'name', + op.alter_column('operating_status', 'name', existing_type=sa.String(255)) - op.alter_column(u'health_monitor_type', u'name', + op.alter_column('health_monitor_type', 'name', existing_type=sa.String(255)) - op.alter_column(u'protocol', u'name', + op.alter_column('protocol', 'name', existing_type=sa.String(255)) - op.alter_column(u'algorithm', u'name', + op.alter_column('algorithm', 'name', existing_type=sa.String(255)) - op.alter_column(u'session_persistence_type', u'name', + op.alter_column('session_persistence_type', 'name', existing_type=sa.String(255)) diff --git a/octavia/db/migration/alembic_migrations/versions/14892634e228_update_vip.py b/octavia/db/migration/alembic_migrations/versions/14892634e228_update_vip.py index c3a03e63b6..a8a5006cfa 100644 --- a/octavia/db/migration/alembic_migrations/versions/14892634e228_update_vip.py +++ b/octavia/db/migration/alembic_migrations/versions/14892634e228_update_vip.py @@ -29,10 +29,10 @@ down_revision = '3a1e1cdb7b27' def upgrade(): - with op.batch_alter_table(u'vip') as batch_op: - batch_op.alter_column(u'subnet_id', new_column_name=u'network_id', + with op.batch_alter_table('vip') as batch_op: + batch_op.alter_column('subnet_id', new_column_name='network_id', existing_type=sa.String(36)) - batch_op.alter_column(u'net_port_id', new_column_name=u'port_id', + batch_op.alter_column('net_port_id', new_column_name='port_id', existing_type=sa.String(36)) - batch_op.drop_column(u'floating_ip_id') - batch_op.drop_column(u'floating_ip_network_id') + batch_op.drop_column('floating_ip_id') + batch_op.drop_column('floating_ip_network_id') diff --git a/octavia/db/migration/alembic_migrations/versions/186509101b9b_add_server_group_id_to_loadbalancer.py b/octavia/db/migration/alembic_migrations/versions/186509101b9b_add_server_group_id_to_loadbalancer.py index 4e75ea0d45..b393fa280c 100644 --- a/octavia/db/migration/alembic_migrations/versions/186509101b9b_add_server_group_id_to_loadbalancer.py +++ b/octavia/db/migration/alembic_migrations/versions/186509101b9b_add_server_group_id_to_loadbalancer.py @@ -30,5 +30,5 @@ down_revision = '458c9ee2a011' def upgrade(): - op.add_column(u'load_balancer', sa.Column(u'server_group_id', - sa.String(36), nullable=True)) + op.add_column('load_balancer', sa.Column('server_group_id', + sa.String(36), nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/1afc932f1ca2_l7rule_support_client_cert.py b/octavia/db/migration/alembic_migrations/versions/1afc932f1ca2_l7rule_support_client_cert.py index cd68e1faf4..4d62e154d7 100644 --- a/octavia/db/migration/alembic_migrations/versions/1afc932f1ca2_l7rule_support_client_cert.py +++ b/octavia/db/migration/alembic_migrations/versions/1afc932f1ca2_l7rule_support_client_cert.py @@ -36,9 +36,9 @@ new_fields = ['SSL_CONN_HAS_CERT', 'SSL_VERIFY_RESULT', 'SSL_DN_FIELD'] def upgrade(): insert_table = sql.table( - u'l7rule_type', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'l7rule_type', + sql.column('name', sa.String), + sql.column('description', sa.String) ) cows = [{'name': field} for field in new_fields] op.bulk_insert(insert_table, cows) diff --git a/octavia/db/migration/alembic_migrations/versions/1e4c1d83044c_keepalived_configuration_datamodel.py b/octavia/db/migration/alembic_migrations/versions/1e4c1d83044c_keepalived_configuration_datamodel.py index 78f2b691a0..67c67f2daf 100644 --- a/octavia/db/migration/alembic_migrations/versions/1e4c1d83044c_keepalived_configuration_datamodel.py +++ b/octavia/db/migration/alembic_migrations/versions/1e4c1d83044c_keepalived_configuration_datamodel.py @@ -30,15 +30,15 @@ down_revision = '5a3ee5472c31' def upgrade(): op.create_table( - u'vrrp_auth_method', - sa.Column(u'name', sa.String(36), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'vrrp_auth_method', + sa.Column('name', sa.String(36), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'vrrp_auth_method', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'vrrp_auth_method', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -50,36 +50,36 @@ def upgrade(): ) op.create_table( - u'vrrp_group', - sa.Column(u'load_balancer_id', sa.String(36), nullable=False), - sa.Column(u'vrrp_group_name', sa.String(36), nullable=True), - sa.Column(u'vrrp_auth_type', sa.String(16), nullable=True), - sa.Column(u'vrrp_auth_pass', sa.String(36), nullable=True), - sa.Column(u'advert_int', sa.Integer(), nullable=True), - sa.PrimaryKeyConstraint(u'load_balancer_id'), - sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], - name=u'fk_vrrp_group_load_balancer_id'), - sa.ForeignKeyConstraint([u'vrrp_auth_type'], - [u'vrrp_auth_method.name'], - name=u'fk_load_balancer_vrrp_auth_method_name') + 'vrrp_group', + sa.Column('load_balancer_id', sa.String(36), nullable=False), + sa.Column('vrrp_group_name', sa.String(36), nullable=True), + sa.Column('vrrp_auth_type', sa.String(16), nullable=True), + sa.Column('vrrp_auth_pass', sa.String(36), nullable=True), + sa.Column('advert_int', sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint('load_balancer_id'), + sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'], + name='fk_vrrp_group_load_balancer_id'), + sa.ForeignKeyConstraint(['vrrp_auth_type'], + ['vrrp_auth_method.name'], + name='fk_load_balancer_vrrp_auth_method_name') ) op.add_column( - u'listener', - sa.Column(u'peer_port', sa.Integer(), nullable=True) + 'listener', + sa.Column('peer_port', sa.Integer(), nullable=True) ) op.add_column( - u'amphora', - sa.Column(u'vrrp_interface', sa.String(16), nullable=True) + 'amphora', + sa.Column('vrrp_interface', sa.String(16), nullable=True) ) op.add_column( - u'amphora', - sa.Column(u'vrrp_id', sa.Integer(), nullable=True) + 'amphora', + sa.Column('vrrp_id', sa.Integer(), nullable=True) ) op.add_column( - u'amphora', - sa.Column(u'vrrp_priority', sa.Integer(), nullable=True) + 'amphora', + sa.Column('vrrp_priority', sa.Integer(), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/2351ea316465_adding_terminate_https_tls_ref_support.py b/octavia/db/migration/alembic_migrations/versions/2351ea316465_adding_terminate_https_tls_ref_support.py index 92a10d1713..fae31486ed 100644 --- a/octavia/db/migration/alembic_migrations/versions/2351ea316465_adding_terminate_https_tls_ref_support.py +++ b/octavia/db/migration/alembic_migrations/versions/2351ea316465_adding_terminate_https_tls_ref_support.py @@ -33,9 +33,9 @@ new_protocol = 'TERMINATED_HTTPS' def upgrade(): insert_table = sql.table( - u'protocol', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'protocol', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -44,5 +44,5 @@ def upgrade(): {'name': new_protocol} ] ) - op.alter_column(u'listener', u'tls_certificate_id', + op.alter_column('listener', 'tls_certificate_id', existing_type=sa.String(255), nullable=True) diff --git a/octavia/db/migration/alembic_migrations/versions/256852d5ff7c_add_lb_network_ip_to_amphora.py b/octavia/db/migration/alembic_migrations/versions/256852d5ff7c_add_lb_network_ip_to_amphora.py index 73910d1bc5..5b0764228d 100644 --- a/octavia/db/migration/alembic_migrations/versions/256852d5ff7c_add_lb_network_ip_to_amphora.py +++ b/octavia/db/migration/alembic_migrations/versions/256852d5ff7c_add_lb_network_ip_to_amphora.py @@ -29,5 +29,5 @@ down_revision = '14892634e228' def upgrade(): - op.add_column(u'amphora', sa.Column(u'lb_network_ip', sa.String(64), - nullable=True)) + op.add_column('amphora', sa.Column('lb_network_ip', sa.String(64), + nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/27e54d00c3cd_add_monitor_address_and_port_to_member.py b/octavia/db/migration/alembic_migrations/versions/27e54d00c3cd_add_monitor_address_and_port_to_member.py index 4403152c7c..7ae6cd6ca7 100644 --- a/octavia/db/migration/alembic_migrations/versions/27e54d00c3cd_add_monitor_address_and_port_to_member.py +++ b/octavia/db/migration/alembic_migrations/versions/27e54d00c3cd_add_monitor_address_and_port_to_member.py @@ -30,13 +30,13 @@ down_revision = '5309960964f8' def upgrade(): - op.add_column(u'member', - sa.Column(u'monitor_address', + op.add_column('member', + sa.Column('monitor_address', sa.String(64), nullable=True) ) - op.add_column(u'member', - sa.Column(u'monitor_port', + op.add_column('member', + sa.Column('monitor_port', sa.Integer(), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/298eac0640a7_add_amphora_vrrp_port_id_and_ha_port_id.py b/octavia/db/migration/alembic_migrations/versions/298eac0640a7_add_amphora_vrrp_port_id_and_ha_port_id.py index b9c039b884..8cc563fad6 100644 --- a/octavia/db/migration/alembic_migrations/versions/298eac0640a7_add_amphora_vrrp_port_id_and_ha_port_id.py +++ b/octavia/db/migration/alembic_migrations/versions/298eac0640a7_add_amphora_vrrp_port_id_and_ha_port_id.py @@ -29,7 +29,7 @@ down_revision = '4fe8240425b4' def upgrade(): - op.add_column(u'amphora', - sa.Column(u'vrrp_port_id', sa.String(36), nullable=True)) - op.add_column(u'amphora', - sa.Column(u'ha_port_id', sa.String(36), nullable=True)) + op.add_column('amphora', + sa.Column('vrrp_port_id', sa.String(36), nullable=True)) + op.add_column('amphora', + sa.Column('ha_port_id', sa.String(36), nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/29ff921a6eb_shared_pools.py b/octavia/db/migration/alembic_migrations/versions/29ff921a6eb_shared_pools.py index c8a7f2a9a7..e1778423b7 100644 --- a/octavia/db/migration/alembic_migrations/versions/29ff921a6eb_shared_pools.py +++ b/octavia/db/migration/alembic_migrations/versions/29ff921a6eb_shared_pools.py @@ -49,7 +49,7 @@ def upgrade(): op.create_foreign_key('fk_listener_pool_id', 'listener', 'pool', ['default_pool_id'], ['id']) - op.add_column(u'pool', + op.add_column('pool', sa.Column('load_balancer_id', sa.String(36), sa.ForeignKey('load_balancer.id'), nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/2ad093f6353f_add_listener_client_ca_tls_certificate_.py b/octavia/db/migration/alembic_migrations/versions/2ad093f6353f_add_listener_client_ca_tls_certificate_.py index 9753b14040..a5db4c8764 100644 --- a/octavia/db/migration/alembic_migrations/versions/2ad093f6353f_add_listener_client_ca_tls_certificate_.py +++ b/octavia/db/migration/alembic_migrations/versions/2ad093f6353f_add_listener_client_ca_tls_certificate_.py @@ -31,7 +31,7 @@ down_revision = '11e4bb2bb8ef' def upgrade(): op.add_column( - u'listener', - sa.Column(u'client_ca_tls_certificate_id', sa.String(255), + 'listener', + sa.Column('client_ca_tls_certificate_id', sa.String(255), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/31f7653ded67_allow_multiple_vips_per_loadbalancer.py b/octavia/db/migration/alembic_migrations/versions/31f7653ded67_allow_multiple_vips_per_loadbalancer.py index 0321e8abc4..1ab3ca9325 100644 --- a/octavia/db/migration/alembic_migrations/versions/31f7653ded67_allow_multiple_vips_per_loadbalancer.py +++ b/octavia/db/migration/alembic_migrations/versions/31f7653ded67_allow_multiple_vips_per_loadbalancer.py @@ -30,15 +30,15 @@ down_revision = '6ac558d7fc21' def upgrade(): op.create_table( - u'additional_vip', - sa.Column(u'load_balancer_id', sa.String(36), nullable=False, + 'additional_vip', + sa.Column('load_balancer_id', sa.String(36), nullable=False, index=True), - sa.Column(u'ip_address', sa.String(64), nullable=True), - sa.Column(u'port_id', sa.String(36), nullable=True), - sa.Column(u'subnet_id', sa.String(36), nullable=True), - sa.Column(u'network_id', sa.String(36), nullable=True), - sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], - name=u'fk_add_vip_load_balancer_id'), - sa.PrimaryKeyConstraint(u'load_balancer_id', u'subnet_id', - name=u'pk_add_vip_load_balancer_subnet'), + sa.Column('ip_address', sa.String(64), nullable=True), + sa.Column('port_id', sa.String(36), nullable=True), + sa.Column('subnet_id', sa.String(36), nullable=True), + sa.Column('network_id', sa.String(36), nullable=True), + sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'], + name='fk_add_vip_load_balancer_id'), + sa.PrimaryKeyConstraint('load_balancer_id', 'subnet_id', + name='pk_add_vip_load_balancer_subnet'), ) diff --git a/octavia/db/migration/alembic_migrations/versions/32e5c35b26a8_add_l7policy_and_l7rule_quota.py b/octavia/db/migration/alembic_migrations/versions/32e5c35b26a8_add_l7policy_and_l7rule_quota.py index 7162230a30..858ec6bb18 100644 --- a/octavia/db/migration/alembic_migrations/versions/32e5c35b26a8_add_l7policy_and_l7rule_quota.py +++ b/octavia/db/migration/alembic_migrations/versions/32e5c35b26a8_add_l7policy_and_l7rule_quota.py @@ -30,11 +30,11 @@ down_revision = 'd3c8a090f3de' def upgrade(): - op.add_column(u'quotas', + op.add_column('quotas', sa.Column('l7policy', sa.Integer(), nullable=True)) - op.add_column(u'quotas', + op.add_column('quotas', sa.Column('l7rule', sa.Integer(), nullable=True)) - op.add_column(u'quotas', + op.add_column('quotas', sa.Column('in_use_l7policy', sa.Integer(), nullable=True)) - op.add_column(u'quotas', + op.add_column('quotas', sa.Column('in_use_l7rule', sa.Integer(), nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/357d17a6d5ac_update_lb_and_amphora_data_model_for_.py b/octavia/db/migration/alembic_migrations/versions/357d17a6d5ac_update_lb_and_amphora_data_model_for_.py index 0e5f17ddc3..8c1776c7bf 100644 --- a/octavia/db/migration/alembic_migrations/versions/357d17a6d5ac_update_lb_and_amphora_data_model_for_.py +++ b/octavia/db/migration/alembic_migrations/versions/357d17a6d5ac_update_lb_and_amphora_data_model_for_.py @@ -32,15 +32,15 @@ down_revision = '298eac0640a7' def upgrade(): op.create_table( - u'lb_topology', - sa.Column(u'name', sa.String(36), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'lb_topology', + sa.Column('name', sa.String(36), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'lb_topology', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'lb_topology', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -52,15 +52,15 @@ def upgrade(): ) op.create_table( - u'amphora_roles', - sa.Column(u'name', sa.String(36), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'amphora_roles', + sa.Column('name', sa.String(36), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'amphora_roles', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'amphora_roles', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -73,17 +73,17 @@ def upgrade(): ) op.add_column( - u'load_balancer', - sa.Column(u'topology', sa.String(36), - sa.ForeignKey(u'lb_topology.name', - name=u'fk_lb_topology_name'), + 'load_balancer', + sa.Column('topology', sa.String(36), + sa.ForeignKey('lb_topology.name', + name='fk_lb_topology_name'), nullable=True) ) op.add_column( - u'amphora', - sa.Column(u'role', sa.String(36), - sa.ForeignKey(u'amphora_roles.name', - name=u'fk_amphora_roles_name'), + 'amphora', + sa.Column('role', sa.String(36), + sa.ForeignKey('amphora_roles.name', + name='fk_amphora_roles_name'), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/35dee79d5865_initial_create.py b/octavia/db/migration/alembic_migrations/versions/35dee79d5865_initial_create.py index 27a0ae03d3..bff883d329 100644 --- a/octavia/db/migration/alembic_migrations/versions/35dee79d5865_initial_create.py +++ b/octavia/db/migration/alembic_migrations/versions/35dee79d5865_initial_create.py @@ -32,16 +32,16 @@ down_revision = None def upgrade(): # Create lookup tables op.create_table( - u'health_monitor_type', - sa.Column(u'name', sa.String(30), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'health_monitor_type', + sa.Column('name', sa.String(30), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) # Create temporary table for table data seeding insert_table = sql.table( - u'health_monitor_type', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'health_monitor_type', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -54,15 +54,15 @@ def upgrade(): ) op.create_table( - u'protocol', - sa.Column(u'name', sa.String(30), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'protocol', + sa.Column('name', sa.String(30), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'protocol', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'protocol', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -75,15 +75,15 @@ def upgrade(): ) op.create_table( - u'algorithm', - sa.Column(u'name', sa.String(30), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'algorithm', + sa.Column('name', sa.String(30), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'algorithm', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'algorithm', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -96,15 +96,15 @@ def upgrade(): ) op.create_table( - u'session_persistence_type', - sa.Column(u'name', sa.String(30), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'session_persistence_type', + sa.Column('name', sa.String(30), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'session_persistence_type', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'session_persistence_type', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -117,15 +117,15 @@ def upgrade(): ) op.create_table( - u'provisioning_status', - sa.Column(u'name', sa.String(30), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'provisioning_status', + sa.Column('name', sa.String(30), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'provisioning_status', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'provisioning_status', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -141,15 +141,15 @@ def upgrade(): ) op.create_table( - u'operating_status', - sa.Column(u'name', sa.String(30), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'operating_status', + sa.Column('name', sa.String(30), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'operating_status', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'operating_status', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -163,190 +163,190 @@ def upgrade(): ) op.create_table( - u'pool', - sa.Column(u'tenant_id', sa.String(255), nullable=True), - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=True), - sa.Column(u'description', sa.String(255), nullable=True), - sa.Column(u'protocol', sa.String(16), nullable=False), - sa.Column(u'lb_algorithm', sa.String(16), nullable=False), - sa.Column(u'operating_status', sa.String(16), nullable=False), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.PrimaryKeyConstraint(u'id'), - sa.ForeignKeyConstraint([u'protocol'], - [u'protocol.name'], - name=u'fk_pool_protocol_name'), - sa.ForeignKeyConstraint([u'lb_algorithm'], - [u'algorithm.name'], - name=u'fk_pool_algorithm_name'), - sa.ForeignKeyConstraint([u'operating_status'], - [u'operating_status.name'], - name=u'fk_pool_operating_status_name') + 'pool', + sa.Column('tenant_id', sa.String(255), nullable=True), + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=True), + sa.Column('description', sa.String(255), nullable=True), + sa.Column('protocol', sa.String(16), nullable=False), + sa.Column('lb_algorithm', sa.String(16), nullable=False), + sa.Column('operating_status', sa.String(16), nullable=False), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.PrimaryKeyConstraint('id'), + sa.ForeignKeyConstraint(['protocol'], + ['protocol.name'], + name='fk_pool_protocol_name'), + sa.ForeignKeyConstraint(['lb_algorithm'], + ['algorithm.name'], + name='fk_pool_algorithm_name'), + sa.ForeignKeyConstraint(['operating_status'], + ['operating_status.name'], + name='fk_pool_operating_status_name') ) op.create_table( - u'health_monitor', - sa.Column(u'pool_id', sa.String(36), nullable=False), - sa.Column(u'type', sa.String(36), nullable=False), - sa.Column(u'delay', sa.Integer(), nullable=False), - sa.Column(u'timeout', sa.Integer(), nullable=False), - sa.Column(u'fall_threshold', sa.Integer(), nullable=False), - sa.Column(u'rise_threshold', sa.Integer(), nullable=False), - sa.Column(u'http_method', sa.String(16), nullable=True), - sa.Column(u'url_path', sa.String(255), nullable=True), - sa.Column(u'expected_codes', sa.String(64), nullable=True), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.PrimaryKeyConstraint(u'pool_id'), - sa.ForeignKeyConstraint([u'pool_id'], [u'pool.id'], - name=u'fk_health_monitor_pool_id'), + 'health_monitor', + sa.Column('pool_id', sa.String(36), nullable=False), + sa.Column('type', sa.String(36), nullable=False), + sa.Column('delay', sa.Integer(), nullable=False), + sa.Column('timeout', sa.Integer(), nullable=False), + sa.Column('fall_threshold', sa.Integer(), nullable=False), + sa.Column('rise_threshold', sa.Integer(), nullable=False), + sa.Column('http_method', sa.String(16), nullable=True), + sa.Column('url_path', sa.String(255), nullable=True), + sa.Column('expected_codes', sa.String(64), nullable=True), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.PrimaryKeyConstraint('pool_id'), + sa.ForeignKeyConstraint(['pool_id'], ['pool.id'], + name='fk_health_monitor_pool_id'), sa.ForeignKeyConstraint( - [u'type'], [u'health_monitor_type.name'], - name=u'fk_health_monitor_health_monitor_type_name') + ['type'], ['health_monitor_type.name'], + name='fk_health_monitor_health_monitor_type_name') ) op.create_table( - u'session_persistence', - sa.Column(u'pool_id', sa.String(36), nullable=False), - sa.Column(u'type', sa.String(16), nullable=False), - sa.Column(u'cookie_name', sa.String(255), nullable=True), + 'session_persistence', + sa.Column('pool_id', sa.String(36), nullable=False), + sa.Column('type', sa.String(16), nullable=False), + sa.Column('cookie_name', sa.String(255), nullable=True), sa.ForeignKeyConstraint( - [u'type'], [u'session_persistence_type.name'], - name=u'fk_session_persistence_session_persistence_type_name'), - sa.ForeignKeyConstraint([u'pool_id'], [u'pool.id'], - name=u'fk_session_persistence_pool_id'), - sa.PrimaryKeyConstraint(u'pool_id') + ['type'], ['session_persistence_type.name'], + name='fk_session_persistence_session_persistence_type_name'), + sa.ForeignKeyConstraint(['pool_id'], ['pool.id'], + name='fk_session_persistence_pool_id'), + sa.PrimaryKeyConstraint('pool_id') ) op.create_table( - u'member', - sa.Column(u'tenant_id', sa.String(255), nullable=True), - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'pool_id', sa.String(36), nullable=False), - sa.Column(u'subnet_id', sa.String(36), nullable=True), - sa.Column(u'address', sa.String(64), nullable=False), - sa.Column(u'protocol_port', sa.Integer(), nullable=False), - sa.Column(u'weight', sa.Integer(), nullable=True), - sa.Column(u'operating_status', sa.String(16), nullable=False), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.PrimaryKeyConstraint(u'id'), - sa.ForeignKeyConstraint([u'pool_id'], [u'pool.id'], - name=u'fk_member_pool_id'), - sa.ForeignKeyConstraint([u'operating_status'], - [u'operating_status.name'], - name=u'fk_member_operating_status_name'), - sa.UniqueConstraint(u'pool_id', u'address', u'protocol_port', - name=u'uq_member_pool_id_address_protocol_port') + 'member', + sa.Column('tenant_id', sa.String(255), nullable=True), + sa.Column('id', sa.String(36), nullable=False), + sa.Column('pool_id', sa.String(36), nullable=False), + sa.Column('subnet_id', sa.String(36), nullable=True), + sa.Column('address', sa.String(64), nullable=False), + sa.Column('protocol_port', sa.Integer(), nullable=False), + sa.Column('weight', sa.Integer(), nullable=True), + sa.Column('operating_status', sa.String(16), nullable=False), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.PrimaryKeyConstraint('id'), + sa.ForeignKeyConstraint(['pool_id'], ['pool.id'], + name='fk_member_pool_id'), + sa.ForeignKeyConstraint(['operating_status'], + ['operating_status.name'], + name='fk_member_operating_status_name'), + sa.UniqueConstraint('pool_id', 'address', 'protocol_port', + name='uq_member_pool_id_address_protocol_port') ) op.create_table( - u'load_balancer', - sa.Column(u'tenant_id', sa.String(255), nullable=True), - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=True), - sa.Column(u'description', sa.String(255), nullable=True), - sa.Column(u'provisioning_status', sa.String(16), nullable=False), - sa.Column(u'operating_status', sa.String(16), nullable=False), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.PrimaryKeyConstraint(u'id'), + 'load_balancer', + sa.Column('tenant_id', sa.String(255), nullable=True), + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=True), + sa.Column('description', sa.String(255), nullable=True), + sa.Column('provisioning_status', sa.String(16), nullable=False), + sa.Column('operating_status', sa.String(16), nullable=False), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.PrimaryKeyConstraint('id'), sa.ForeignKeyConstraint( - [u'provisioning_status'], [u'provisioning_status.name'], - name=u'fk_load_balancer_provisioning_status_name'), - sa.ForeignKeyConstraint([u'operating_status'], - [u'operating_status.name'], - name=u'fk_load_balancer_operating_status_name') + ['provisioning_status'], ['provisioning_status.name'], + name='fk_load_balancer_provisioning_status_name'), + sa.ForeignKeyConstraint(['operating_status'], + ['operating_status.name'], + name='fk_load_balancer_operating_status_name') ) op.create_table( - u'vip', - sa.Column(u'load_balancer_id', sa.String(36), nullable=False), - sa.Column(u'ip_address', sa.String(36), nullable=True), - sa.Column(u'net_port_id', sa.String(36), nullable=True), - sa.Column(u'subnet_id', sa.String(36), nullable=True), - sa.Column(u'floating_ip_id', sa.String(36), nullable=True), - sa.Column(u'floating_ip_network_id', sa.String(36), nullable=True), - sa.PrimaryKeyConstraint(u'load_balancer_id'), - sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], - name=u'fk_vip_load_balancer_id') + 'vip', + sa.Column('load_balancer_id', sa.String(36), nullable=False), + sa.Column('ip_address', sa.String(36), nullable=True), + sa.Column('net_port_id', sa.String(36), nullable=True), + sa.Column('subnet_id', sa.String(36), nullable=True), + sa.Column('floating_ip_id', sa.String(36), nullable=True), + sa.Column('floating_ip_network_id', sa.String(36), nullable=True), + sa.PrimaryKeyConstraint('load_balancer_id'), + sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'], + name='fk_vip_load_balancer_id') ) op.create_table( - u'listener', - sa.Column(u'tenant_id', sa.String(255), nullable=True), - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=True), - sa.Column(u'description', sa.String(255), nullable=True), - sa.Column(u'protocol', sa.String(16), nullable=False), - sa.Column(u'protocol_port', sa.Integer(), nullable=False), - sa.Column(u'connection_limit', sa.Integer(), nullable=True), - sa.Column(u'load_balancer_id', sa.String(36), nullable=True), - sa.Column(u'tls_certificate_id', sa.String(36), nullable=True), - sa.Column(u'default_pool_id', sa.String(36), nullable=True), - sa.Column(u'provisioning_status', sa.String(16), nullable=False), - sa.Column(u'operating_status', sa.String(16), nullable=False), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], - name=u'fk_listener_load_balancer_id'), - sa.ForeignKeyConstraint([u'default_pool_id'], [u'pool.id'], - name=u'fk_listener_pool_id'), - sa.ForeignKeyConstraint([u'protocol'], [u'protocol.name'], - name=u'fk_listener_protocol_name'), - sa.ForeignKeyConstraint([u'provisioning_status'], - [u'provisioning_status.name'], - name=u'fk_listener_provisioning_status_name'), - sa.ForeignKeyConstraint([u'operating_status'], - [u'operating_status.name'], - name=u'fk_listener_operating_status_name'), - sa.UniqueConstraint(u'default_pool_id', - name=u'uq_listener_default_pool_id'), + 'listener', + sa.Column('tenant_id', sa.String(255), nullable=True), + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=True), + sa.Column('description', sa.String(255), nullable=True), + sa.Column('protocol', sa.String(16), nullable=False), + sa.Column('protocol_port', sa.Integer(), nullable=False), + sa.Column('connection_limit', sa.Integer(), nullable=True), + sa.Column('load_balancer_id', sa.String(36), nullable=True), + sa.Column('tls_certificate_id', sa.String(36), nullable=True), + sa.Column('default_pool_id', sa.String(36), nullable=True), + sa.Column('provisioning_status', sa.String(16), nullable=False), + sa.Column('operating_status', sa.String(16), nullable=False), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'], + name='fk_listener_load_balancer_id'), + sa.ForeignKeyConstraint(['default_pool_id'], ['pool.id'], + name='fk_listener_pool_id'), + sa.ForeignKeyConstraint(['protocol'], ['protocol.name'], + name='fk_listener_protocol_name'), + sa.ForeignKeyConstraint(['provisioning_status'], + ['provisioning_status.name'], + name='fk_listener_provisioning_status_name'), + sa.ForeignKeyConstraint(['operating_status'], + ['operating_status.name'], + name='fk_listener_operating_status_name'), + sa.UniqueConstraint('default_pool_id', + name='uq_listener_default_pool_id'), sa.UniqueConstraint( - u'load_balancer_id', u'protocol_port', - name=u'uq_listener_load_balancer_id_protocol_port'), - sa.PrimaryKeyConstraint(u'id') + 'load_balancer_id', 'protocol_port', + name='uq_listener_load_balancer_id_protocol_port'), + sa.PrimaryKeyConstraint('id') ) op.create_table( - u'sni', - sa.Column(u'listener_id', sa.String(36), nullable=False), - sa.Column(u'tls_container_id', sa.String(36), nullable=False), - sa.Column(u'position', sa.Integer, nullable=True), - sa.ForeignKeyConstraint([u'listener_id'], [u'listener.id'], - name=u'fk_sni_listener_id'), - sa.PrimaryKeyConstraint(u'listener_id', u'tls_container_id') + 'sni', + sa.Column('listener_id', sa.String(36), nullable=False), + sa.Column('tls_container_id', sa.String(36), nullable=False), + sa.Column('position', sa.Integer, nullable=True), + sa.ForeignKeyConstraint(['listener_id'], ['listener.id'], + name='fk_sni_listener_id'), + sa.PrimaryKeyConstraint('listener_id', 'tls_container_id') ) op.create_table( - u'listener_statistics', - sa.Column(u'listener_id', sa.String(36), nullable=False), - sa.Column(u'bytes_in', sa.BigInteger(), nullable=False), - sa.Column(u'bytes_out', sa.BigInteger(), nullable=False), - sa.Column(u'active_connections', sa.Integer(), nullable=False), - sa.Column(u'total_connections', sa.BigInteger(), nullable=False), - sa.PrimaryKeyConstraint(u'listener_id'), - sa.ForeignKeyConstraint([u'listener_id'], [u'listener.id'], - name=u'fk_listener_statistics_listener_id') + 'listener_statistics', + sa.Column('listener_id', sa.String(36), nullable=False), + sa.Column('bytes_in', sa.BigInteger(), nullable=False), + sa.Column('bytes_out', sa.BigInteger(), nullable=False), + sa.Column('active_connections', sa.Integer(), nullable=False), + sa.Column('total_connections', sa.BigInteger(), nullable=False), + sa.PrimaryKeyConstraint('listener_id'), + sa.ForeignKeyConstraint(['listener_id'], ['listener.id'], + name='fk_listener_statistics_listener_id') ) op.create_table( - u'amphora', + 'amphora', # id should come from the service providing the amphora (i.e. nova) - sa.Column(u'id', sa.String(36), nullable=False, autoincrement=False), - sa.Column(u'host_id', sa.String(36), nullable=False), - sa.Column(u'status', sa.String(36), nullable=False), - sa.PrimaryKeyConstraint(u'id'), + sa.Column('id', sa.String(36), nullable=False, autoincrement=False), + sa.Column('host_id', sa.String(36), nullable=False), + sa.Column('status', sa.String(36), nullable=False), + sa.PrimaryKeyConstraint('id'), sa.ForeignKeyConstraint( - [u'status'], [u'provisioning_status.name'], - name=u'fk_container_provisioning_status_name') + ['status'], ['provisioning_status.name'], + name='fk_container_provisioning_status_name') ) op.create_table( - u'load_balancer_amphora', - sa.Column(u'amphora_id', sa.String(36), nullable=False), - sa.Column(u'load_balancer_id', sa.String(36), nullable=False), + 'load_balancer_amphora', + sa.Column('amphora_id', sa.String(36), nullable=False), + sa.Column('load_balancer_id', sa.String(36), nullable=False), sa.ForeignKeyConstraint( - [u'load_balancer_id'], [u'load_balancer.id'], - name=u'fk_load_balancer_amphora_load_balancer_id'), - sa.ForeignKeyConstraint([u'amphora_id'], - [u'amphora.id'], - name=u'fk_load_balancer_amphora_id'), - sa.PrimaryKeyConstraint(u'amphora_id', u'load_balancer_id') + ['load_balancer_id'], ['load_balancer.id'], + name='fk_load_balancer_amphora_load_balancer_id'), + sa.ForeignKeyConstraint(['amphora_id'], + ['amphora.id'], + name='fk_load_balancer_amphora_id'), + sa.PrimaryKeyConstraint('amphora_id', 'load_balancer_id') ) diff --git a/octavia/db/migration/alembic_migrations/versions/36b94648fef8_add_timestamp.py b/octavia/db/migration/alembic_migrations/versions/36b94648fef8_add_timestamp.py index 697e12c0b6..c242e05ac0 100644 --- a/octavia/db/migration/alembic_migrations/versions/36b94648fef8_add_timestamp.py +++ b/octavia/db/migration/alembic_migrations/versions/36b94648fef8_add_timestamp.py @@ -34,9 +34,9 @@ def upgrade(): for table in tables: op.add_column( table, - sa.Column(u'created_at', sa.DateTime(), nullable=True) + sa.Column('created_at', sa.DateTime(), nullable=True) ) op.add_column( table, - sa.Column(u'updated_at', sa.DateTime(), nullable=True) + sa.Column('updated_at', sa.DateTime(), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/392fb85b4419_add_primary_key_to_spares_pool.py b/octavia/db/migration/alembic_migrations/versions/392fb85b4419_add_primary_key_to_spares_pool.py index cdfb2f115c..09e723d3db 100644 --- a/octavia/db/migration/alembic_migrations/versions/392fb85b4419_add_primary_key_to_spares_pool.py +++ b/octavia/db/migration/alembic_migrations/versions/392fb85b4419_add_primary_key_to_spares_pool.py @@ -39,7 +39,7 @@ def upgrade(): pk = inspector.get_pk_constraint('spares_pool') if not pk['constrained_columns']: op.create_primary_key( - u'pk_spares_pool', u'spares_pool', [u'updated_at']) + 'pk_spares_pool', 'spares_pool', ['updated_at']) else: # Revision '46d914b2a5e5' has been updated to create the # missing PK. Depending whether the env is already deployed or diff --git a/octavia/db/migration/alembic_migrations/versions/3a1e1cdb7b27_rename_amphora_host_id.py b/octavia/db/migration/alembic_migrations/versions/3a1e1cdb7b27_rename_amphora_host_id.py index 0f068d003b..622f8116e9 100644 --- a/octavia/db/migration/alembic_migrations/versions/3a1e1cdb7b27_rename_amphora_host_id.py +++ b/octavia/db/migration/alembic_migrations/versions/3a1e1cdb7b27_rename_amphora_host_id.py @@ -29,5 +29,5 @@ down_revision = '4faaa983e7a9' def upgrade(): - op.alter_column(u'amphora', u'host_id', new_column_name='compute_id', + op.alter_column('amphora', 'host_id', new_column_name='compute_id', existing_type=sa.String(36), nullable=True) diff --git a/octavia/db/migration/alembic_migrations/versions/3e5b37a0bdb9_add_vrrp_ip_and_ha_ip_to_amphora.py b/octavia/db/migration/alembic_migrations/versions/3e5b37a0bdb9_add_vrrp_ip_and_ha_ip_to_amphora.py index 162c58e47a..6d306283d7 100644 --- a/octavia/db/migration/alembic_migrations/versions/3e5b37a0bdb9_add_vrrp_ip_and_ha_ip_to_amphora.py +++ b/octavia/db/migration/alembic_migrations/versions/3e5b37a0bdb9_add_vrrp_ip_and_ha_ip_to_amphora.py @@ -29,7 +29,7 @@ down_revision = '92fe9857279' def upgrade(): - op.add_column(u'amphora', - sa.Column(u'vrrp_ip', sa.String(64), nullable=True)) - op.add_column(u'amphora', - sa.Column(u'ha_ip', sa.String(64), nullable=True)) + op.add_column('amphora', + sa.Column('vrrp_ip', sa.String(64), nullable=True)) + op.add_column('amphora', + sa.Column('ha_ip', sa.String(64), nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/3f8ff3be828e_create_quotas_table.py b/octavia/db/migration/alembic_migrations/versions/3f8ff3be828e_create_quotas_table.py index 986e9c2764..dc90ed1b69 100644 --- a/octavia/db/migration/alembic_migrations/versions/3f8ff3be828e_create_quotas_table.py +++ b/octavia/db/migration/alembic_migrations/versions/3f8ff3be828e_create_quotas_table.py @@ -29,17 +29,17 @@ down_revision = '44a2414dd683' def upgrade(): op.create_table( - u'quotas', - sa.Column(u'project_id', sa.String(36), primary_key=True, + 'quotas', + sa.Column('project_id', sa.String(36), primary_key=True, nullable=False), - sa.Column(u'health_monitor', sa.Integer(), nullable=True), - sa.Column(u'load_balancer', sa.Integer(), nullable=True), - sa.Column(u'listener', sa.Integer(), nullable=True), - sa.Column(u'member', sa.Integer(), nullable=True), - sa.Column(u'pool', sa.Integer(), nullable=True), - sa.Column(u'in_use_health_monitor', sa.Integer(), nullable=True), - sa.Column(u'in_use_load_balancer', sa.Integer(), nullable=True), - sa.Column(u'in_use_listener', sa.Integer(), nullable=True), - sa.Column(u'in_use_member', sa.Integer(), nullable=True), - sa.Column(u'in_use_pool', sa.Integer(), nullable=True), + sa.Column('health_monitor', sa.Integer(), nullable=True), + sa.Column('load_balancer', sa.Integer(), nullable=True), + sa.Column('listener', sa.Integer(), nullable=True), + sa.Column('member', sa.Integer(), nullable=True), + sa.Column('pool', sa.Integer(), nullable=True), + sa.Column('in_use_health_monitor', sa.Integer(), nullable=True), + sa.Column('in_use_load_balancer', sa.Integer(), nullable=True), + sa.Column('in_use_listener', sa.Integer(), nullable=True), + sa.Column('in_use_member', sa.Integer(), nullable=True), + sa.Column('in_use_pool', sa.Integer(), nullable=True), ) diff --git a/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py b/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py index 781e644207..7daf1879f2 100644 --- a/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py +++ b/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py @@ -30,14 +30,14 @@ down_revision = '6abb04f24c5' def upgrade(): op.drop_constraint( - u'fk_pool_algorithm_name', u'pool', - type_=u'foreignkey' + 'fk_pool_algorithm_name', 'pool', + type_='foreignkey' ) - op.alter_column(u'algorithm', u'name', nullable=False, + op.alter_column('algorithm', 'name', nullable=False, existing_type=sa.String(255)) - op.alter_column(u'pool', u'lb_algorithm', nullable=False, + op.alter_column('pool', 'lb_algorithm', nullable=False, existing_type=sa.String(255)) op.create_foreign_key( - u'fk_pool_algorithm_name', u'pool', - u'algorithm', [u'lb_algorithm'], [u'name'] + 'fk_pool_algorithm_name', 'pool', + 'algorithm', ['lb_algorithm'], ['name'] ) diff --git a/octavia/db/migration/alembic_migrations/versions/443fe6676637_add_network_id_to_vip.py b/octavia/db/migration/alembic_migrations/versions/443fe6676637_add_network_id_to_vip.py index a01fc03149..51b042d092 100644 --- a/octavia/db/migration/alembic_migrations/versions/443fe6676637_add_network_id_to_vip.py +++ b/octavia/db/migration/alembic_migrations/versions/443fe6676637_add_network_id_to_vip.py @@ -28,5 +28,5 @@ down_revision = '3f8ff3be828e' def upgrade(): - op.add_column(u'vip', - sa.Column(u'network_id', sa.String(36), nullable=True)) + op.add_column('vip', + sa.Column('network_id', sa.String(36), nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/44a2414dd683_adding_name_column_to_member_and_health_.py b/octavia/db/migration/alembic_migrations/versions/44a2414dd683_adding_name_column_to_member_and_health_.py index 95142d37ad..c41ce1d571 100644 --- a/octavia/db/migration/alembic_migrations/versions/44a2414dd683_adding_name_column_to_member_and_health_.py +++ b/octavia/db/migration/alembic_migrations/versions/44a2414dd683_adding_name_column_to_member_and_health_.py @@ -35,5 +35,5 @@ def upgrade(): for table in tables: op.add_column( table, - sa.Column(u'name', sa.String(255), nullable=True) + sa.Column('name', sa.String(255), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/458c9ee2a011_l7_policies_and_rules.py b/octavia/db/migration/alembic_migrations/versions/458c9ee2a011_l7_policies_and_rules.py index e7a0e2984b..9fea0360e2 100644 --- a/octavia/db/migration/alembic_migrations/versions/458c9ee2a011_l7_policies_and_rules.py +++ b/octavia/db/migration/alembic_migrations/versions/458c9ee2a011_l7_policies_and_rules.py @@ -32,16 +32,16 @@ down_revision = '29ff921a6eb' def upgrade(): # L7 Rule Types op.create_table( - u'l7rule_type', - sa.Column(u'name', sa.String(36), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'l7rule_type', + sa.Column('name', sa.String(36), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) # Create temporary table for table data seeding insert_table = sql.table( - u'l7rule_type', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'l7rule_type', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -57,15 +57,15 @@ def upgrade(): # L7 Rule Compare Types op.create_table( - u'l7rule_compare_type', - sa.Column(u'name', sa.String(36), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'l7rule_compare_type', + sa.Column('name', sa.String(36), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'l7rule_compare_type', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'l7rule_compare_type', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -81,15 +81,15 @@ def upgrade(): # L7 Policy Actions op.create_table( - u'l7policy_action', - sa.Column(u'name', sa.String(36), primary_key=True), - sa.Column(u'description', sa.String(255), nullable=True) + 'l7policy_action', + sa.Column('name', sa.String(36), primary_key=True), + sa.Column('description', sa.String(255), nullable=True) ) insert_table = sql.table( - u'l7policy_action', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'l7policy_action', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( @@ -103,47 +103,47 @@ def upgrade(): # L7 Policies op.create_table( - u'l7policy', - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=True), - sa.Column(u'description', sa.String(255), nullable=True), - sa.Column(u'listener_id', sa.String(36), nullable=False), - sa.Column(u'action', sa.String(36), nullable=False), - sa.Column(u'redirect_pool_id', sa.String(36), nullable=True), - sa.Column(u'redirect_url', sa.String(255), nullable=True), - sa.Column(u'position', sa.Integer, nullable=False), - sa.Column(u'enabled', sa.Boolean(), default=True, nullable=False), + 'l7policy', + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=True), + sa.Column('description', sa.String(255), nullable=True), + sa.Column('listener_id', sa.String(36), nullable=False), + sa.Column('action', sa.String(36), nullable=False), + sa.Column('redirect_pool_id', sa.String(36), nullable=True), + sa.Column('redirect_url', sa.String(255), nullable=True), + sa.Column('position', sa.Integer, nullable=False), + sa.Column('enabled', sa.Boolean(), default=True, nullable=False), - sa.PrimaryKeyConstraint(u'id'), - sa.ForeignKeyConstraint([u'listener_id'], - [u'listener.id'], - name=u'fk_l7policy_listener_id'), - sa.ForeignKeyConstraint([u'redirect_pool_id'], - [u'pool.id'], - name=u'fk_l7policy_pool_id'), - sa.ForeignKeyConstraint([u'action'], - [u'l7policy_action.name'], - name=u'fk_l7policy_l7policy_action_name') + sa.PrimaryKeyConstraint('id'), + sa.ForeignKeyConstraint(['listener_id'], + ['listener.id'], + name='fk_l7policy_listener_id'), + sa.ForeignKeyConstraint(['redirect_pool_id'], + ['pool.id'], + name='fk_l7policy_pool_id'), + sa.ForeignKeyConstraint(['action'], + ['l7policy_action.name'], + name='fk_l7policy_l7policy_action_name') ) # L7 Rules op.create_table( - u'l7rule', - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'l7policy_id', sa.String(36), nullable=False), - sa.Column(u'type', sa.String(36), nullable=False), - sa.Column(u'compare_type', sa.String(36), nullable=False), - sa.Column(u'key', sa.String(255), nullable=True), - sa.Column(u'value', sa.String(255), nullable=False), - sa.Column(u'invert', sa.Boolean(), default=False, nullable=False), - sa.PrimaryKeyConstraint(u'id'), - sa.ForeignKeyConstraint([u'l7policy_id'], - [u'l7policy.id'], - name=u'fk_l7rule_l7policy_id'), - sa.ForeignKeyConstraint([u'type'], - [u'l7rule_type.name'], - name=u'fk_l7rule_l7rule_type_name'), - sa.ForeignKeyConstraint([u'compare_type'], - [u'l7rule_compare_type.name'], - name=u'fk_l7rule_l7rule_compare_type_name') + 'l7rule', + sa.Column('id', sa.String(36), nullable=False), + sa.Column('l7policy_id', sa.String(36), nullable=False), + sa.Column('type', sa.String(36), nullable=False), + sa.Column('compare_type', sa.String(36), nullable=False), + sa.Column('key', sa.String(255), nullable=True), + sa.Column('value', sa.String(255), nullable=False), + sa.Column('invert', sa.Boolean(), default=False, nullable=False), + sa.PrimaryKeyConstraint('id'), + sa.ForeignKeyConstraint(['l7policy_id'], + ['l7policy.id'], + name='fk_l7rule_l7policy_id'), + sa.ForeignKeyConstraint(['type'], + ['l7rule_type.name'], + name='fk_l7rule_l7rule_type_name'), + sa.ForeignKeyConstraint(['compare_type'], + ['l7rule_compare_type.name'], + name='fk_l7rule_l7rule_compare_type_name') ) diff --git a/octavia/db/migration/alembic_migrations/versions/46d914b2a5e5_seed_the_spares_pool_table.py b/octavia/db/migration/alembic_migrations/versions/46d914b2a5e5_seed_the_spares_pool_table.py index 145f2bec94..32add94c5b 100644 --- a/octavia/db/migration/alembic_migrations/versions/46d914b2a5e5_seed_the_spares_pool_table.py +++ b/octavia/db/migration/alembic_migrations/versions/46d914b2a5e5_seed_the_spares_pool_table.py @@ -34,8 +34,8 @@ down_revision = '6ffc710674ef' def upgrade(): # Create temporary table for table data seeding insert_table = sa.table( - u'spares_pool', - sa.column(u'updated_at', sa.DateTime), + 'spares_pool', + sa.column('updated_at', sa.DateTime), ) # Note: The date/time doesn't matter, we just need to seed the table. diff --git a/octavia/db/migration/alembic_migrations/versions/48660b6643f0_add_new_states_for_amphora.py b/octavia/db/migration/alembic_migrations/versions/48660b6643f0_add_new_states_for_amphora.py index b96b91d4ad..763dbbe3b7 100644 --- a/octavia/db/migration/alembic_migrations/versions/48660b6643f0_add_new_states_for_amphora.py +++ b/octavia/db/migration/alembic_migrations/versions/48660b6643f0_add_new_states_for_amphora.py @@ -32,9 +32,9 @@ down_revision = '3e5b37a0bdb9' def upgrade(): insert_table = sql.table( - u'provisioning_status', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'provisioning_status', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/4c094013699a_update_load_balancer_amphora.py b/octavia/db/migration/alembic_migrations/versions/4c094013699a_update_load_balancer_amphora.py index f8de464baf..5c744cdcdd 100644 --- a/octavia/db/migration/alembic_migrations/versions/4c094013699a_update_load_balancer_amphora.py +++ b/octavia/db/migration/alembic_migrations/versions/4c094013699a_update_load_balancer_amphora.py @@ -30,18 +30,18 @@ down_revision = '35dee79d5865' def upgrade(): op.add_column( - u'amphora', - sa.Column(u'load_balancer_id', sa.String(36), - sa.ForeignKey(u'load_balancer.id', - name=u'fk_amphora_load_balancer_id'), + 'amphora', + sa.Column('load_balancer_id', sa.String(36), + sa.ForeignKey('load_balancer.id', + name='fk_amphora_load_balancer_id'), nullable=True) ) - op.drop_table(u'load_balancer_amphora') + op.drop_table('load_balancer_amphora') op.drop_constraint( - u'fk_container_provisioning_status_name', u'amphora', - type_=u'foreignkey' + 'fk_container_provisioning_status_name', 'amphora', + type_='foreignkey' ) op.create_foreign_key( - u'fk_amphora_provisioning_status_name', u'amphora', - u'provisioning_status', [u'status'], [u'name'] + 'fk_amphora_provisioning_status_name', 'amphora', + 'provisioning_status', ['status'], ['name'] ) diff --git a/octavia/db/migration/alembic_migrations/versions/4f65b4f91c39_amphora_add_flavor_id.py b/octavia/db/migration/alembic_migrations/versions/4f65b4f91c39_amphora_add_flavor_id.py index c360e178dc..baca46b230 100644 --- a/octavia/db/migration/alembic_migrations/versions/4f65b4f91c39_amphora_add_flavor_id.py +++ b/octavia/db/migration/alembic_migrations/versions/4f65b4f91c39_amphora_add_flavor_id.py @@ -31,6 +31,6 @@ down_revision = '80dba23a159f' def upgrade(): op.add_column( - u'amphora', - sa.Column(u'compute_flavor', sa.String(255), nullable=True) + 'amphora', + sa.Column('compute_flavor', sa.String(255), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/4faaa983e7a9_update_member_address_column.py b/octavia/db/migration/alembic_migrations/versions/4faaa983e7a9_update_member_address_column.py index e9c4434e4d..affd32f7ee 100644 --- a/octavia/db/migration/alembic_migrations/versions/4faaa983e7a9_update_member_address_column.py +++ b/octavia/db/migration/alembic_migrations/versions/4faaa983e7a9_update_member_address_column.py @@ -29,5 +29,5 @@ down_revision = '13500e2e978d' def upgrade(): - op.alter_column(u'member', u'address', new_column_name=u'ip_address', + op.alter_column('member', 'address', new_column_name='ip_address', existing_type=sa.String(64)) diff --git a/octavia/db/migration/alembic_migrations/versions/4fe8240425b4_update_vip_add_subnet_id.py b/octavia/db/migration/alembic_migrations/versions/4fe8240425b4_update_vip_add_subnet_id.py index daf941be40..a5b1459800 100644 --- a/octavia/db/migration/alembic_migrations/versions/4fe8240425b4_update_vip_add_subnet_id.py +++ b/octavia/db/migration/alembic_migrations/versions/4fe8240425b4_update_vip_add_subnet_id.py @@ -28,6 +28,6 @@ down_revision = '48660b6643f0' def upgrade(): - with op.batch_alter_table(u'vip') as batch_op: - batch_op.alter_column(u'network_id', new_column_name=u'subnet_id', + with op.batch_alter_table('vip') as batch_op: + batch_op.alter_column('network_id', new_column_name='subnet_id', existing_type=sa.String(36)) diff --git a/octavia/db/migration/alembic_migrations/versions/52377704420e_add_timestamps_to_healthmonitor.py b/octavia/db/migration/alembic_migrations/versions/52377704420e_add_timestamps_to_healthmonitor.py index 2990537c1b..cfba5f2523 100644 --- a/octavia/db/migration/alembic_migrations/versions/52377704420e_add_timestamps_to_healthmonitor.py +++ b/octavia/db/migration/alembic_migrations/versions/52377704420e_add_timestamps_to_healthmonitor.py @@ -32,24 +32,24 @@ down_revision = 'd85ca7258d21' def upgrade(): op.add_column( - u'health_monitor', - sa.Column(u'created_at', sa.DateTime(), nullable=True) + 'health_monitor', + sa.Column('created_at', sa.DateTime(), nullable=True) ) op.add_column( - u'health_monitor', - sa.Column(u'updated_at', sa.DateTime(), nullable=True) + 'health_monitor', + sa.Column('updated_at', sa.DateTime(), nullable=True) ) - op.add_column(u'health_monitor', - sa.Column(u'operating_status', + op.add_column('health_monitor', + sa.Column('operating_status', sa.String(16), nullable=False, server_default=constants.ONLINE) ) - op.alter_column(u'health_monitor', u'operating_status', + op.alter_column('health_monitor', 'operating_status', existing_type=sa.String(16), server_default=None) op.create_foreign_key( - u'fk_health_monitor_operating_status_name', u'health_monitor', - u'operating_status', [u'operating_status'], [u'name'] + 'fk_health_monitor_operating_status_name', 'health_monitor', + 'operating_status', ['operating_status'], ['name'] ) diff --git a/octavia/db/migration/alembic_migrations/versions/5309960964f8_add_proxy_protocol_for_pool.py b/octavia/db/migration/alembic_migrations/versions/5309960964f8_add_proxy_protocol_for_pool.py index 453216e1eb..a3aa014b55 100644 --- a/octavia/db/migration/alembic_migrations/versions/5309960964f8_add_proxy_protocol_for_pool.py +++ b/octavia/db/migration/alembic_migrations/versions/5309960964f8_add_proxy_protocol_for_pool.py @@ -33,9 +33,9 @@ new_protocol = 'PROXY' def upgrade(): insert_table = sql.table( - u'protocol', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'protocol', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/543f5d8e4e56_add_a_column_busy_in_table_amphora_health.py b/octavia/db/migration/alembic_migrations/versions/543f5d8e4e56_add_a_column_busy_in_table_amphora_health.py index 814f7d5033..c286dec98f 100644 --- a/octavia/db/migration/alembic_migrations/versions/543f5d8e4e56_add_a_column_busy_in_table_amphora_health.py +++ b/octavia/db/migration/alembic_migrations/versions/543f5d8e4e56_add_a_column_busy_in_table_amphora_health.py @@ -28,5 +28,5 @@ down_revision = '2351ea316465' def upgrade(): - op.add_column(u'amphora_health', - sa.Column(u'busy', sa.Boolean(), nullable=False)) + op.add_column('amphora_health', + sa.Column('busy', sa.Boolean(), nullable=False)) diff --git a/octavia/db/migration/alembic_migrations/versions/55874a4ceed6_add_l7policy_action_redirect_prefix.py b/octavia/db/migration/alembic_migrations/versions/55874a4ceed6_add_l7policy_action_redirect_prefix.py index 831286abcf..57c4908570 100644 --- a/octavia/db/migration/alembic_migrations/versions/55874a4ceed6_add_l7policy_action_redirect_prefix.py +++ b/octavia/db/migration/alembic_migrations/versions/55874a4ceed6_add_l7policy_action_redirect_prefix.py @@ -32,13 +32,13 @@ down_revision = '76aacf2e176c' def upgrade(): # Add column redirect_prefix op.add_column( - u'l7policy', - sa.Column(u'redirect_prefix', sa.String(255), nullable=True) + 'l7policy', + sa.Column('redirect_prefix', sa.String(255), nullable=True) ) insert_table = sql.table( - u'l7policy_action', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'l7policy_action', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/5a3ee5472c31_add_cert_expiration__infor_in_amphora_table.py b/octavia/db/migration/alembic_migrations/versions/5a3ee5472c31_add_cert_expiration__infor_in_amphora_table.py index e3dc7abd7c..a00a76a6ae 100644 --- a/octavia/db/migration/alembic_migrations/versions/5a3ee5472c31_add_cert_expiration__infor_in_amphora_table.py +++ b/octavia/db/migration/alembic_migrations/versions/5a3ee5472c31_add_cert_expiration__infor_in_amphora_table.py @@ -28,10 +28,10 @@ down_revision = '3b199c848b96' def upgrade(): - op.add_column(u'amphora', - sa.Column(u'cert_expiration', sa.DateTime(timezone=True), + op.add_column('amphora', + sa.Column('cert_expiration', sa.DateTime(timezone=True), nullable=True) ) - op.add_column(u'amphora', sa.Column(u'cert_busy', sa.Boolean(), - nullable=False, default=False)) + op.add_column('amphora', sa.Column('cert_busy', sa.Boolean(), + nullable=False, default=False)) diff --git a/octavia/db/migration/alembic_migrations/versions/62816c232310_fix_migration_for_mysql_5_7.py b/octavia/db/migration/alembic_migrations/versions/62816c232310_fix_migration_for_mysql_5_7.py index 2ad51f877b..df4a81bd91 100644 --- a/octavia/db/migration/alembic_migrations/versions/62816c232310_fix_migration_for_mysql_5_7.py +++ b/octavia/db/migration/alembic_migrations/versions/62816c232310_fix_migration_for_mysql_5_7.py @@ -29,5 +29,5 @@ down_revision = '36b94648fef8' def upgrade(): - op.alter_column(u'sni', u'tls_container_id', type_=sa.String(128), + op.alter_column('sni', 'tls_container_id', type_=sa.String(128), existing_type=sa.String(36), nullable=False) diff --git a/octavia/db/migration/alembic_migrations/versions/6742ca1b27c2_add_l7policy_redirect_http_code.py b/octavia/db/migration/alembic_migrations/versions/6742ca1b27c2_add_l7policy_redirect_http_code.py index 0115dfce6c..b974bc996d 100644 --- a/octavia/db/migration/alembic_migrations/versions/6742ca1b27c2_add_l7policy_redirect_http_code.py +++ b/octavia/db/migration/alembic_migrations/versions/6742ca1b27c2_add_l7policy_redirect_http_code.py @@ -31,6 +31,6 @@ down_revision = 'a7f187cd221f' def upgrade(): # Add column redirect_prefix op.add_column( - u'l7policy', - sa.Column(u'redirect_http_code', sa.Integer(), nullable=True) + 'l7policy', + sa.Column('redirect_http_code', sa.Integer(), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/6ac558d7fc21_add_prometheus_listener_protocol.py b/octavia/db/migration/alembic_migrations/versions/6ac558d7fc21_add_prometheus_listener_protocol.py index 906d9322e5..0d4e1af9de 100644 --- a/octavia/db/migration/alembic_migrations/versions/6ac558d7fc21_add_prometheus_listener_protocol.py +++ b/octavia/db/migration/alembic_migrations/versions/6ac558d7fc21_add_prometheus_listener_protocol.py @@ -32,9 +32,9 @@ new_protocol = 'PROMETHEUS' def upgrade(): insert_table = sql.table( - u'protocol', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'protocol', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/6ffc710674ef_spares_pool_table.py b/octavia/db/migration/alembic_migrations/versions/6ffc710674ef_spares_pool_table.py index 07a091228c..a7ae9a3438 100644 --- a/octavia/db/migration/alembic_migrations/versions/6ffc710674ef_spares_pool_table.py +++ b/octavia/db/migration/alembic_migrations/versions/6ffc710674ef_spares_pool_table.py @@ -30,6 +30,6 @@ down_revision = '7432f1d4ea83' def upgrade(): op.create_table( - u'spares_pool', - sa.Column(u'updated_at', sa.DateTime(), primary_key=True, + 'spares_pool', + sa.Column('updated_at', sa.DateTime(), primary_key=True, server_default=sa.func.current_timestamp())) diff --git a/octavia/db/migration/alembic_migrations/versions/7432f1d4ea83_add_http_host_head_inject_for_http_health_check.py b/octavia/db/migration/alembic_migrations/versions/7432f1d4ea83_add_http_host_head_inject_for_http_health_check.py index ff1d3b77be..c15722ea30 100644 --- a/octavia/db/migration/alembic_migrations/versions/7432f1d4ea83_add_http_host_head_inject_for_http_health_check.py +++ b/octavia/db/migration/alembic_migrations/versions/7432f1d4ea83_add_http_host_head_inject_for_http_health_check.py @@ -30,10 +30,10 @@ down_revision = '6742ca1b27c2' def upgrade(): op.add_column( - u'health_monitor', - sa.Column(u'http_version', sa.Float(), nullable=True) + 'health_monitor', + sa.Column('http_version', sa.Float(), nullable=True) ) op.add_column( - u'health_monitor', - sa.Column(u'domain_name', sa.String(255), nullable=True) + 'health_monitor', + sa.Column('domain_name', sa.String(255), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/74aae261694c_extend_pool_for_backend_ca_and_crl.py b/octavia/db/migration/alembic_migrations/versions/74aae261694c_extend_pool_for_backend_ca_and_crl.py index 655be0464d..c472a4a571 100644 --- a/octavia/db/migration/alembic_migrations/versions/74aae261694c_extend_pool_for_backend_ca_and_crl.py +++ b/octavia/db/migration/alembic_migrations/versions/74aae261694c_extend_pool_for_backend_ca_and_crl.py @@ -30,7 +30,7 @@ down_revision = 'a1f689aecc1d' def upgrade(): - op.add_column(u'pool', sa.Column(u'ca_tls_certificate_id', sa.String(255), - nullable=True)) - op.add_column(u'pool', sa.Column(u'crl_container_id', sa.String(255), - nullable=True)) + op.add_column('pool', sa.Column('ca_tls_certificate_id', sa.String(255), + nullable=True)) + op.add_column('pool', sa.Column('crl_container_id', sa.String(255), + nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/76aacf2e176c_extend_support_udp_protocol.py b/octavia/db/migration/alembic_migrations/versions/76aacf2e176c_extend_support_udp_protocol.py index 0297ca3b16..bbc8edb00b 100644 --- a/octavia/db/migration/alembic_migrations/versions/76aacf2e176c_extend_support_udp_protocol.py +++ b/octavia/db/migration/alembic_migrations/versions/76aacf2e176c_extend_support_udp_protocol.py @@ -30,7 +30,7 @@ from sqlalchemy import sql revision = '76aacf2e176c' down_revision = 'ebbcc72b4e5e' -tables = [u'protocol', u'health_monitor_type'] +tables = ['protocol', 'health_monitor_type'] new_fields = ['UDP', 'UDP-CONNECT'] @@ -40,8 +40,8 @@ def upgrade(): for table, new_field in zip(tables, new_fields): insert_table = sql.table( table, - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/80dba23a159f_tags_support.py b/octavia/db/migration/alembic_migrations/versions/80dba23a159f_tags_support.py index d600ddffc0..5c791cba1c 100644 --- a/octavia/db/migration/alembic_migrations/versions/80dba23a159f_tags_support.py +++ b/octavia/db/migration/alembic_migrations/versions/80dba23a159f_tags_support.py @@ -29,9 +29,9 @@ down_revision = '55874a4ceed6' def upgrade(): op.create_table( - u'tags', - sa.Column(u'resource_id', sa.String(36), primary_key=True, + 'tags', + sa.Column('resource_id', sa.String(36), primary_key=True, nullable=False), - sa.Column(u'tag', sa.String(255), primary_key=True, nullable=False, + sa.Column('tag', sa.String(255), primary_key=True, nullable=False, index=True), ) diff --git a/octavia/db/migration/alembic_migrations/versions/82b9402e71fd_update_vip_address_size.py b/octavia/db/migration/alembic_migrations/versions/82b9402e71fd_update_vip_address_size.py index e92ac561ae..05a82d27f3 100644 --- a/octavia/db/migration/alembic_migrations/versions/82b9402e71fd_update_vip_address_size.py +++ b/octavia/db/migration/alembic_migrations/versions/82b9402e71fd_update_vip_address_size.py @@ -29,5 +29,5 @@ down_revision = '4a6ec0ab7284' def upgrade(): - op.alter_column(u'vip', u'ip_address', + op.alter_column('vip', 'ip_address', existing_type=sa.String(64)) diff --git a/octavia/db/migration/alembic_migrations/versions/8ac4ed24df3a_add_availability_zone_to_lb.py b/octavia/db/migration/alembic_migrations/versions/8ac4ed24df3a_add_availability_zone_to_lb.py index d3dcdc14b5..34664f9eea 100644 --- a/octavia/db/migration/alembic_migrations/versions/8ac4ed24df3a_add_availability_zone_to_lb.py +++ b/octavia/db/migration/alembic_migrations/versions/8ac4ed24df3a_add_availability_zone_to_lb.py @@ -29,13 +29,13 @@ down_revision = 'c761c8a71579' def upgrade(): - op.add_column(u'load_balancer', - sa.Column(u'availability_zone', + op.add_column('load_balancer', + sa.Column('availability_zone', sa.String(255), nullable=True) ) op.create_foreign_key( - u'fk_load_balancer_availability_zone_name', u'load_balancer', - u'availability_zone', [u'availability_zone'], [u'name'] + 'fk_load_balancer_availability_zone_name', 'load_balancer', + 'availability_zone', ['availability_zone'], ['name'] ) diff --git a/octavia/db/migration/alembic_migrations/versions/8b47b2546312_sctp_support.py b/octavia/db/migration/alembic_migrations/versions/8b47b2546312_sctp_support.py index d6165050e8..8753f2b90b 100644 --- a/octavia/db/migration/alembic_migrations/versions/8b47b2546312_sctp_support.py +++ b/octavia/db/migration/alembic_migrations/versions/8b47b2546312_sctp_support.py @@ -34,8 +34,8 @@ def upgrade(): for table in ['protocol', 'health_monitor_type']: insert_table = sql.table( table, - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/8c0851bdf6c3_change_tls_container_id_length_in_sni_.py b/octavia/db/migration/alembic_migrations/versions/8c0851bdf6c3_change_tls_container_id_length_in_sni_.py index a963d8352b..ec65f4a406 100644 --- a/octavia/db/migration/alembic_migrations/versions/8c0851bdf6c3_change_tls_container_id_length_in_sni_.py +++ b/octavia/db/migration/alembic_migrations/versions/8c0851bdf6c3_change_tls_container_id_length_in_sni_.py @@ -29,5 +29,5 @@ down_revision = '186509101b9b' def upgrade(): - op.alter_column(u'sni', u'tls_container_id', type_=sa.String(128), + op.alter_column('sni', 'tls_container_id', type_=sa.String(128), existing_type=sa.String(36), nullable=False) diff --git a/octavia/db/migration/alembic_migrations/versions/92fe9857279_create_healthmanager_table.py b/octavia/db/migration/alembic_migrations/versions/92fe9857279_create_healthmanager_table.py index 58f16031fc..a707bfd8ce 100644 --- a/octavia/db/migration/alembic_migrations/versions/92fe9857279_create_healthmanager_table.py +++ b/octavia/db/migration/alembic_migrations/versions/92fe9857279_create_healthmanager_table.py @@ -29,10 +29,10 @@ down_revision = '256852d5ff7c' def upgrade(): op.create_table( - u'amphora_health', - sa.Column(u'amphora_id', sa.String(36), nullable=False, + 'amphora_health', + sa.Column('amphora_id', sa.String(36), nullable=False, primary_key=True), - sa.Column(u'last_update', sa.DateTime(timezone=True), + sa.Column('last_update', sa.DateTime(timezone=True), nullable=False) ) diff --git a/octavia/db/migration/alembic_migrations/versions/9b5473976d6d_add_provisioning_status_to_objects.py b/octavia/db/migration/alembic_migrations/versions/9b5473976d6d_add_provisioning_status_to_objects.py index 337bb0fd55..82cf9de2e6 100644 --- a/octavia/db/migration/alembic_migrations/versions/9b5473976d6d_add_provisioning_status_to_objects.py +++ b/octavia/db/migration/alembic_migrations/versions/9b5473976d6d_add_provisioning_status_to_objects.py @@ -36,8 +36,8 @@ def upgrade(): nullable=True) ) op.create_foreign_key( - u'fk_health_monitor_provisioning_status_name', u'health_monitor', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_health_monitor_provisioning_status_name', 'health_monitor', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.add_column('l7policy', @@ -46,8 +46,8 @@ def upgrade(): nullable=True) ) op.create_foreign_key( - u'fk_l7policy_provisioning_status_name', u'l7policy', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_l7policy_provisioning_status_name', 'l7policy', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.add_column('l7rule', @@ -56,8 +56,8 @@ def upgrade(): nullable=True) ) op.create_foreign_key( - u'fk_l7rule_provisioning_status_name', u'l7rule', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_l7rule_provisioning_status_name', 'l7rule', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.add_column('member', @@ -66,8 +66,8 @@ def upgrade(): nullable=True) ) op.create_foreign_key( - u'fk_member_provisioning_status_name', u'member', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_member_provisioning_status_name', 'member', + 'provisioning_status', ['provisioning_status'], ['name'] ) op.add_column('pool', @@ -76,6 +76,6 @@ def upgrade(): nullable=True) ) op.create_foreign_key( - u'fk_pool_provisioning_status_name', u'pool', - u'provisioning_status', [u'provisioning_status'], [u'name'] + 'fk_pool_provisioning_status_name', 'pool', + 'provisioning_status', ['provisioning_status'], ['name'] ) diff --git a/octavia/db/migration/alembic_migrations/versions/a1f689aecc1d_extend_pool_for_support_backend_reencryption.py b/octavia/db/migration/alembic_migrations/versions/a1f689aecc1d_extend_pool_for_support_backend_reencryption.py index f19934a85c..390390a1a1 100644 --- a/octavia/db/migration/alembic_migrations/versions/a1f689aecc1d_extend_pool_for_support_backend_reencryption.py +++ b/octavia/db/migration/alembic_migrations/versions/a1f689aecc1d_extend_pool_for_support_backend_reencryption.py @@ -31,5 +31,5 @@ down_revision = '1afc932f1ca2' def upgrade(): - op.add_column(u'pool', sa.Column(u'tls_certificate_id', sa.String(255), - nullable=True)) + op.add_column('pool', sa.Column('tls_certificate_id', sa.String(255), + nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/a7f187cd221f_add_tls_boolean_type_for_reencryption.py b/octavia/db/migration/alembic_migrations/versions/a7f187cd221f_add_tls_boolean_type_for_reencryption.py index 9fddf0afea..0abbbc0b2c 100644 --- a/octavia/db/migration/alembic_migrations/versions/a7f187cd221f_add_tls_boolean_type_for_reencryption.py +++ b/octavia/db/migration/alembic_migrations/versions/a7f187cd221f_add_tls_boolean_type_for_reencryption.py @@ -31,7 +31,7 @@ down_revision = '74aae261694c' def upgrade(): - op.add_column(u'pool', - sa.Column(u'tls_enabled', sa.Boolean(), + op.add_column('pool', + sa.Column('tls_enabled', sa.Boolean(), server_default=sa.sql.expression.false(), nullable=False)) diff --git a/octavia/db/migration/alembic_migrations/versions/b9c703669314_add_flavor_and_flavor_profile_table.py b/octavia/db/migration/alembic_migrations/versions/b9c703669314_add_flavor_and_flavor_profile_table.py index 10d1dffef4..618f1011a7 100644 --- a/octavia/db/migration/alembic_migrations/versions/b9c703669314_add_flavor_and_flavor_profile_table.py +++ b/octavia/db/migration/alembic_migrations/versions/b9c703669314_add_flavor_and_flavor_profile_table.py @@ -31,23 +31,23 @@ down_revision = '4f65b4f91c39' def upgrade(): op.create_table( - u'flavor_profile', - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=False), - sa.Column(u'provider_name', sa.String(255), nullable=False), - sa.Column(u'flavor_data', sa.String(4096), nullable=False), - sa.PrimaryKeyConstraint(u'id')) + 'flavor_profile', + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('provider_name', sa.String(255), nullable=False), + sa.Column('flavor_data', sa.String(4096), nullable=False), + sa.PrimaryKeyConstraint('id')) op.create_table( - u'flavor', - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=False), - sa.Column(u'description', sa.String(255), nullable=True), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.Column(u'flavor_profile_id', sa.String(36), nullable=False), - sa.ForeignKeyConstraint([u'flavor_profile_id'], - [u'flavor_profile.id'], - name=u'fk_flavor_flavor_profile_id'), - sa.PrimaryKeyConstraint(u'id'), - sa.UniqueConstraint(u'name', - name=u'uq_flavor_name'),) + 'flavor', + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('description', sa.String(255), nullable=True), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.Column('flavor_profile_id', sa.String(36), nullable=False), + sa.ForeignKeyConstraint(['flavor_profile_id'], + ['flavor_profile.id'], + name='fk_flavor_flavor_profile_id'), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('name', + name='uq_flavor_name'),) diff --git a/octavia/db/migration/alembic_migrations/versions/ba35e0fb88e1_add_backup_field_to_member.py b/octavia/db/migration/alembic_migrations/versions/ba35e0fb88e1_add_backup_field_to_member.py index 0c96446e80..3d2ecc7f87 100644 --- a/octavia/db/migration/alembic_migrations/versions/ba35e0fb88e1_add_backup_field_to_member.py +++ b/octavia/db/migration/alembic_migrations/versions/ba35e0fb88e1_add_backup_field_to_member.py @@ -30,5 +30,5 @@ down_revision = '034756a182a2' def upgrade(): - op.add_column(u'member', sa.Column(u'backup', sa.Boolean(), - nullable=False, default=False)) + op.add_column('member', sa.Column('backup', sa.Boolean(), + nullable=False, default=False)) diff --git a/octavia/db/migration/alembic_migrations/versions/bf171d0d91c3_amphora_add_cached_zone.py b/octavia/db/migration/alembic_migrations/versions/bf171d0d91c3_amphora_add_cached_zone.py index 40c8bf0225..cc8acc7f5d 100644 --- a/octavia/db/migration/alembic_migrations/versions/bf171d0d91c3_amphora_add_cached_zone.py +++ b/octavia/db/migration/alembic_migrations/versions/bf171d0d91c3_amphora_add_cached_zone.py @@ -29,5 +29,5 @@ down_revision = '4aeb9e23ad43' def upgrade(): - op.add_column(u'amphora', sa.Column(u'cached_zone', sa.String(255), - nullable=True)) + op.add_column('amphora', sa.Column('cached_zone', sa.String(255), + nullable=True)) diff --git a/octavia/db/migration/alembic_migrations/versions/c761c8a71579_add_availability_zone_table.py b/octavia/db/migration/alembic_migrations/versions/c761c8a71579_add_availability_zone_table.py index 417ae1b3ac..9a3210fe41 100644 --- a/octavia/db/migration/alembic_migrations/versions/c761c8a71579_add_availability_zone_table.py +++ b/octavia/db/migration/alembic_migrations/versions/c761c8a71579_add_availability_zone_table.py @@ -32,12 +32,12 @@ down_revision = 'e37941b010db' def upgrade(): azp_table = op.create_table( - u'availability_zone_profile', - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=False), - sa.Column(u'provider_name', sa.String(255), nullable=False), - sa.Column(u'availability_zone_data', sa.String(4096), nullable=False), - sa.PrimaryKeyConstraint(u'id')) + 'availability_zone_profile', + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('provider_name', sa.String(255), nullable=False), + sa.Column('availability_zone_data', sa.String(4096), nullable=False), + sa.PrimaryKeyConstraint('id')) op.bulk_insert( azp_table, @@ -48,16 +48,16 @@ def upgrade(): ) az_table = op.create_table( - u'availability_zone', - sa.Column(u'name', sa.String(255), nullable=False), - sa.Column(u'description', sa.String(255), nullable=True), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.Column(u'availability_zone_profile_id', sa.String(36), + 'availability_zone', + sa.Column('name', sa.String(255), nullable=False), + sa.Column('description', sa.String(255), nullable=True), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.Column('availability_zone_profile_id', sa.String(36), nullable=False), - sa.ForeignKeyConstraint([u'availability_zone_profile_id'], - [u'availability_zone_profile.id'], - name=u'fk_az_az_profile_id'), - sa.PrimaryKeyConstraint(u'name'),) + sa.ForeignKeyConstraint(['availability_zone_profile_id'], + ['availability_zone_profile.id'], + name='fk_az_az_profile_id'), + sa.PrimaryKeyConstraint('name'),) op.bulk_insert( az_table, diff --git a/octavia/db/migration/alembic_migrations/versions/d85ca7258d21_modernize_l7rule.py b/octavia/db/migration/alembic_migrations/versions/d85ca7258d21_modernize_l7rule.py index 11e91ed5ae..b61c67b6c9 100644 --- a/octavia/db/migration/alembic_migrations/versions/d85ca7258d21_modernize_l7rule.py +++ b/octavia/db/migration/alembic_migrations/versions/d85ca7258d21_modernize_l7rule.py @@ -33,39 +33,39 @@ down_revision = '034b2dc2f3e0' def upgrade(): # Add timing data op.add_column( - u'l7rule', - sa.Column(u'created_at', sa.DateTime(), nullable=True) + 'l7rule', + sa.Column('created_at', sa.DateTime(), nullable=True) ) op.add_column( - u'l7rule', - sa.Column(u'updated_at', sa.DateTime(), nullable=True) + 'l7rule', + sa.Column('updated_at', sa.DateTime(), nullable=True) ) # Add project_id op.add_column( - u'l7rule', - sa.Column(u'project_id', sa.String(36), nullable=True) + 'l7rule', + sa.Column('project_id', sa.String(36), nullable=True) ) # Add enabled op.add_column( - u'l7rule', - sa.Column(u'enabled', sa.Boolean(), + 'l7rule', + sa.Column('enabled', sa.Boolean(), server_default=sa.sql.expression.true(), nullable=False) ) # Add new operating_status column, setting existing rows to ONLINE op.add_column( - u'l7rule', - sa.Column(u'operating_status', sa.String(16), + 'l7rule', + sa.Column('operating_status', sa.String(16), nullable=False, server_default=constants.ONLINE) ) # Remove the default, as we don't actually want one - op.alter_column(u'l7rule', u'operating_status', + op.alter_column('l7rule', 'operating_status', existing_type=sa.String(16), server_default=None) # Add the foreign key for operating_status_name op.create_foreign_key( - u'fk_l7rule_operating_status_name', u'l7rule', - u'operating_status', [u'operating_status'], [u'name'] + 'fk_l7rule_operating_status_name', 'l7rule', + 'operating_status', ['operating_status'], ['name'] ) diff --git a/octavia/db/migration/alembic_migrations/versions/da371b422669_allowed_cidr_for_listeners.py b/octavia/db/migration/alembic_migrations/versions/da371b422669_allowed_cidr_for_listeners.py index 57e53accb8..997fab164a 100644 --- a/octavia/db/migration/alembic_migrations/versions/da371b422669_allowed_cidr_for_listeners.py +++ b/octavia/db/migration/alembic_migrations/versions/da371b422669_allowed_cidr_for_listeners.py @@ -29,12 +29,12 @@ down_revision = 'a5762a99609a' def upgrade(): op.create_table( - u'listener_cidr', - sa.Column(u'listener_id', sa.String(36), nullable=False), - sa.Column(u'cidr', sa.String(64), nullable=False), + 'listener_cidr', + sa.Column('listener_id', sa.String(36), nullable=False), + sa.Column('cidr', sa.String(64), nullable=False), - sa.ForeignKeyConstraint([u'listener_id'], - [u'listener.id'], - name=u'fk_listener_cidr_listener_id'), - sa.PrimaryKeyConstraint(u'listener_id', u'cidr') + sa.ForeignKeyConstraint(['listener_id'], + ['listener.id'], + name='fk_listener_cidr_listener_id'), + sa.PrimaryKeyConstraint('listener_id', 'cidr') ) diff --git a/octavia/db/migration/alembic_migrations/versions/dcf88e59aae4_add_lb_algorithm_source_ip_port.py b/octavia/db/migration/alembic_migrations/versions/dcf88e59aae4_add_lb_algorithm_source_ip_port.py index ed6277576d..f61cdcc786 100644 --- a/octavia/db/migration/alembic_migrations/versions/dcf88e59aae4_add_lb_algorithm_source_ip_port.py +++ b/octavia/db/migration/alembic_migrations/versions/dcf88e59aae4_add_lb_algorithm_source_ip_port.py @@ -55,8 +55,8 @@ def migrate_pools(): def upgrade(): insert_table = sa.table( - u'algorithm', - sa.column(u'name', sa.String(255)), + 'algorithm', + sa.column('name', sa.String(255)), ) op.bulk_insert( insert_table, diff --git a/octavia/db/migration/alembic_migrations/versions/e37941b010db_add_lb_flavor_constraint.py b/octavia/db/migration/alembic_migrations/versions/e37941b010db_add_lb_flavor_constraint.py index 436254e166..63b7745e70 100644 --- a/octavia/db/migration/alembic_migrations/versions/e37941b010db_add_lb_flavor_constraint.py +++ b/octavia/db/migration/alembic_migrations/versions/e37941b010db_add_lb_flavor_constraint.py @@ -32,11 +32,11 @@ down_revision = 'dcf88e59aae4' def upgrade(): insert_table = sql.table( - u'flavor_profile', - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=False), - sa.Column(u'provider_name', sa.String(255), nullable=False), - sa.Column(u'flavor_data', sa.String(4096), nullable=False), + 'flavor_profile', + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('provider_name', sa.String(255), nullable=False), + sa.Column('flavor_data', sa.String(4096), nullable=False), ) op.bulk_insert( @@ -48,12 +48,12 @@ def upgrade(): ) insert_table = sql.table( - u'flavor', - sa.Column(u'id', sa.String(36), nullable=False), - sa.Column(u'name', sa.String(255), nullable=False), - sa.Column(u'description', sa.String(255), nullable=True), - sa.Column(u'enabled', sa.Boolean(), nullable=False), - sa.Column(u'flavor_profile_id', sa.String(36), nullable=False), + 'flavor', + sa.Column('id', sa.String(36), nullable=False), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('description', sa.String(255), nullable=True), + sa.Column('enabled', sa.Boolean(), nullable=False), + sa.Column('flavor_profile_id', sa.String(36), nullable=False), ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/e6672bda93bf_add_ping_and_tlshello_monitor_types.py b/octavia/db/migration/alembic_migrations/versions/e6672bda93bf_add_ping_and_tlshello_monitor_types.py index bfcd2a0e1d..bd8ec82684 100644 --- a/octavia/db/migration/alembic_migrations/versions/e6672bda93bf_add_ping_and_tlshello_monitor_types.py +++ b/octavia/db/migration/alembic_migrations/versions/e6672bda93bf_add_ping_and_tlshello_monitor_types.py @@ -31,9 +31,9 @@ down_revision = '27e54d00c3cd' def upgrade(): insert_table = sql.table( - u'health_monitor_type', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'health_monitor_type', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/e6ee84f0abf3_add_proxy_v2_pool_protocol.py b/octavia/db/migration/alembic_migrations/versions/e6ee84f0abf3_add_proxy_v2_pool_protocol.py index 663c1e2cfd..41a2e70a0c 100644 --- a/octavia/db/migration/alembic_migrations/versions/e6ee84f0abf3_add_proxy_v2_pool_protocol.py +++ b/octavia/db/migration/alembic_migrations/versions/e6ee84f0abf3_add_proxy_v2_pool_protocol.py @@ -30,9 +30,9 @@ down_revision = '2ab994dd3ec2' def upgrade(): insert_table = sql.table( - u'protocol', - sql.column(u'name', sa.String), - sql.column(u'description', sa.String) + 'protocol', + sql.column('name', sa.String), + sql.column('description', sa.String) ) op.bulk_insert( diff --git a/octavia/db/migration/alembic_migrations/versions/ebbcc72b4e5e_add_octavia_owned_vip_column_to_vip_.py b/octavia/db/migration/alembic_migrations/versions/ebbcc72b4e5e_add_octavia_owned_vip_column_to_vip_.py index b595bdb0df..f13149e0b0 100644 --- a/octavia/db/migration/alembic_migrations/versions/ebbcc72b4e5e_add_octavia_owned_vip_column_to_vip_.py +++ b/octavia/db/migration/alembic_migrations/versions/ebbcc72b4e5e_add_octavia_owned_vip_column_to_vip_.py @@ -29,6 +29,6 @@ down_revision = '0f242cf02c74' def upgrade(): op.add_column( - u'vip', - sa.Column(u'octavia_owned', sa.Boolean(), nullable=True) + 'vip', + sa.Column('octavia_owned', sa.Boolean(), nullable=True) ) diff --git a/octavia/db/migration/alembic_migrations/versions/f21ae3f21adc_add_client_auth_option.py b/octavia/db/migration/alembic_migrations/versions/f21ae3f21adc_add_client_auth_option.py index f245899262..1436b273cd 100644 --- a/octavia/db/migration/alembic_migrations/versions/f21ae3f21adc_add_client_auth_option.py +++ b/octavia/db/migration/alembic_migrations/versions/f21ae3f21adc_add_client_auth_option.py @@ -34,14 +34,14 @@ down_revision = '2ad093f6353f' def upgrade(): op.create_table( - u'client_authentication_mode', - sa.Column(u'name', sa.String(10), primary_key=True), + 'client_authentication_mode', + sa.Column('name', sa.String(10), primary_key=True), ) # Create temporary table for table data seeding insert_table = sa.table( - u'client_authentication_mode', - sa.column(u'name', sa.String), + 'client_authentication_mode', + sa.column('name', sa.String), ) op.bulk_insert( @@ -54,8 +54,8 @@ def upgrade(): ) op.add_column( - u'listener', - sa.Column(u'client_authentication', sa.String(10), + 'listener', + sa.Column('client_authentication', sa.String(10), sa.ForeignKey('client_authentication_mode.name'), server_default=constants.CLIENT_AUTH_NONE, nullable=False) ) diff --git a/octavia/db/migration/alembic_migrations/versions/fc5582da7d8a_create_amphora_build_rate_limit_tables.py b/octavia/db/migration/alembic_migrations/versions/fc5582da7d8a_create_amphora_build_rate_limit_tables.py index 690820ce9a..832d4e8799 100644 --- a/octavia/db/migration/alembic_migrations/versions/fc5582da7d8a_create_amphora_build_rate_limit_tables.py +++ b/octavia/db/migration/alembic_migrations/versions/fc5582da7d8a_create_amphora_build_rate_limit_tables.py @@ -31,16 +31,16 @@ down_revision = '443fe6676637' def upgrade(): op.create_table( - u'amphora_build_slots', - sa.Column(u'id', sa.Integer(), primary_key=True), - sa.Column(u'slots_used', sa.Integer(), default=0) + 'amphora_build_slots', + sa.Column('id', sa.Integer(), primary_key=True), + sa.Column('slots_used', sa.Integer(), default=0) ) # Create temporary table for table data seeding insert_table = sql.table( - u'amphora_build_slots', - sql.column(u'id', sa.Integer), - sql.column(u'slots_used', sa.Integer) + 'amphora_build_slots', + sql.column('id', sa.Integer), + sql.column('slots_used', sa.Integer) ) op.bulk_insert( @@ -51,12 +51,12 @@ def upgrade(): ) op.create_table( - u'amphora_build_request', - sa.Column(u'amphora_id', sa.String(36), nullable=True, + 'amphora_build_request', + sa.Column('amphora_id', sa.String(36), nullable=True, primary_key=True), - sa.Column(u'priority', sa.Integer()), - sa.Column(u'created_time', sa.DateTime(timezone=True), nullable=False), - sa.Column(u'status', sa.String(16), default='WAITING', nullable=False) + sa.Column('priority', sa.Integer()), + sa.Column('created_time', sa.DateTime(timezone=True), nullable=False), + sa.Column('status', sa.String(16), default='WAITING', nullable=False) ) diff --git a/octavia/db/migration/alembic_migrations/versions/ffad172e98c1_add_certificate_revoke_list_option.py b/octavia/db/migration/alembic_migrations/versions/ffad172e98c1_add_certificate_revoke_list_option.py index 2873b6270c..fce291f147 100644 --- a/octavia/db/migration/alembic_migrations/versions/ffad172e98c1_add_certificate_revoke_list_option.py +++ b/octavia/db/migration/alembic_migrations/versions/ffad172e98c1_add_certificate_revoke_list_option.py @@ -31,6 +31,6 @@ down_revision = 'f21ae3f21adc' def upgrade(): - op.add_column(u'listener', - sa.Column(u'client_crl_container_id', sa.String(255), + op.add_column('listener', + sa.Column('client_crl_container_id', sa.String(255), nullable=True)) diff --git a/octavia/db/models.py b/octavia/db/models.py index e59447af05..e1ab20ba32 100644 --- a/octavia/db/models.py +++ b/octavia/db/models.py @@ -185,7 +185,7 @@ class ListenerStatistics(base_models.BASE): self.total_connections += other.total_connections else: raise TypeError( # noqa: O342 - "unsupported operand type(s) for +=: '{0}' and '{1}'".format( + "unsupported operand type(s) for +=: '{}' and '{}'".format( type(self), type(other))) return self diff --git a/octavia/db/repositories.py b/octavia/db/repositories.py index b0ed8a6ab0..cc4bd6f8a3 100644 --- a/octavia/db/repositories.py +++ b/octavia/db/repositories.py @@ -49,7 +49,7 @@ CONF = cfg.CONF LOG = logging.getLogger(__name__) -class BaseRepository(object): +class BaseRepository: model_class = None def count(self, session, **filters): @@ -209,7 +209,7 @@ class BaseRepository(object): return id_list -class Repositories(object): +class Repositories: def __init__(self): self.load_balancer = LoadBalancerRepository() self.vip = VipRepository() @@ -1943,7 +1943,7 @@ class QuotasRepository(BaseRepository): session.flush() -class _GetALLExceptDELETEDIdMixin(object): +class _GetALLExceptDELETEDIdMixin: def get_all(self, session, pagination_helper=None, query_options=None, **filters):