From b023d61b525cbce798cbf73b2372b786c77cbbe3 Mon Sep 17 00:00:00 2001 From: chenghuiyu Date: Thu, 23 Nov 2017 00:36:14 +0800 Subject: [PATCH] No need to use getattr func to get a value Change-Id: I15aab99dbf3cf37e32ed0be41807b0c88e41ae3a --- .../versions/004_fix_resource_routings_pod_id_length.py | 4 ++-- .../versions/005_fix_cached_endpoints_pod_id_length.py | 4 ++-- .../versions/008_fix_shadow_agents_pod_id_length.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tricircle/db/migrate_repo/versions/004_fix_resource_routings_pod_id_length.py b/tricircle/db/migrate_repo/versions/004_fix_resource_routings_pod_id_length.py index 3527a35c..11edcf16 100644 --- a/tricircle/db/migrate_repo/versions/004_fix_resource_routings_pod_id_length.py +++ b/tricircle/db/migrate_repo/versions/004_fix_resource_routings_pod_id_length.py @@ -21,8 +21,8 @@ def upgrade(migrate_engine): resource_routings = Table('resource_routings', meta, autoload=True) pods = Table('pods', meta, autoload=True) - col_pod_id_fkey = getattr(resource_routings.c, 'pod_id') - col_pod_id_pkey = getattr(pods.c, 'pod_id') + col_pod_id_fkey = resource_routings.c.pod_id + col_pod_id_pkey = pods.c.pod_id # In the migration script 002_resource.py, the pod_id string length in # resource_routings table is 64, but pod_id string length in pods table diff --git a/tricircle/db/migrate_repo/versions/005_fix_cached_endpoints_pod_id_length.py b/tricircle/db/migrate_repo/versions/005_fix_cached_endpoints_pod_id_length.py index d802a800..cc34daad 100644 --- a/tricircle/db/migrate_repo/versions/005_fix_cached_endpoints_pod_id_length.py +++ b/tricircle/db/migrate_repo/versions/005_fix_cached_endpoints_pod_id_length.py @@ -21,8 +21,8 @@ def upgrade(migrate_engine): cached_endpoints = Table('cached_endpoints', meta, autoload=True) pods = Table('pods', meta, autoload=True) - col_pod_id_fkey = getattr(cached_endpoints.c, 'pod_id') - col_pod_id_pkey = getattr(pods.c, 'pod_id') + col_pod_id_fkey = cached_endpoints.c.pod_id + col_pod_id_pkey = pods.c.pod_id # In the migration script 001_init.py, the pod_id string length in # cached_endpoints table is 64, but pod_id string length in pods table diff --git a/tricircle/db/migrate_repo/versions/008_fix_shadow_agents_pod_id_length.py b/tricircle/db/migrate_repo/versions/008_fix_shadow_agents_pod_id_length.py index 6d96684c..1b41e85b 100644 --- a/tricircle/db/migrate_repo/versions/008_fix_shadow_agents_pod_id_length.py +++ b/tricircle/db/migrate_repo/versions/008_fix_shadow_agents_pod_id_length.py @@ -21,8 +21,8 @@ def upgrade(migrate_engine): shadow_agents = Table('shadow_agents', meta, autoload=True) pods = Table('pods', meta, autoload=True) - col_pod_id_fkey = getattr(shadow_agents.c, 'pod_id') - col_pod_id_pkey = getattr(pods.c, 'pod_id') + col_pod_id_fkey = shadow_agents.c.pod_id + col_pod_id_pkey = pods.c.pod_id # In the migration script 003_shadow_agent.py, the pod_id string length in # shadow_agents table is 64, but pod_id string length in pods table