No need to use getattr func to get a value

Change-Id: I15aab99dbf3cf37e32ed0be41807b0c88e41ae3a
This commit is contained in:
chenghuiyu 2017-11-23 00:36:14 +08:00
parent 7c7232e4ae
commit b023d61b52
3 changed files with 6 additions and 6 deletions

View File

@ -21,8 +21,8 @@ def upgrade(migrate_engine):
resource_routings = Table('resource_routings', meta, autoload=True) resource_routings = Table('resource_routings', meta, autoload=True)
pods = Table('pods', meta, autoload=True) pods = Table('pods', meta, autoload=True)
col_pod_id_fkey = getattr(resource_routings.c, 'pod_id') col_pod_id_fkey = resource_routings.c.pod_id
col_pod_id_pkey = getattr(pods.c, 'pod_id') col_pod_id_pkey = pods.c.pod_id
# In the migration script 002_resource.py, the pod_id string length in # 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 # resource_routings table is 64, but pod_id string length in pods table

View File

@ -21,8 +21,8 @@ def upgrade(migrate_engine):
cached_endpoints = Table('cached_endpoints', meta, autoload=True) cached_endpoints = Table('cached_endpoints', meta, autoload=True)
pods = Table('pods', meta, autoload=True) pods = Table('pods', meta, autoload=True)
col_pod_id_fkey = getattr(cached_endpoints.c, 'pod_id') col_pod_id_fkey = cached_endpoints.c.pod_id
col_pod_id_pkey = getattr(pods.c, 'pod_id') col_pod_id_pkey = pods.c.pod_id
# In the migration script 001_init.py, the pod_id string length in # 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 # cached_endpoints table is 64, but pod_id string length in pods table

View File

@ -21,8 +21,8 @@ def upgrade(migrate_engine):
shadow_agents = Table('shadow_agents', meta, autoload=True) shadow_agents = Table('shadow_agents', meta, autoload=True)
pods = Table('pods', meta, autoload=True) pods = Table('pods', meta, autoload=True)
col_pod_id_fkey = getattr(shadow_agents.c, 'pod_id') col_pod_id_fkey = shadow_agents.c.pod_id
col_pod_id_pkey = getattr(pods.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 # 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 # shadow_agents table is 64, but pod_id string length in pods table