Browse Source

No need to use getattr func to get a value

Change-Id: I15aab99dbf3cf37e32ed0be41807b0c88e41ae3a
changes/42/522442/1
chenghuiyu 3 years ago
parent
commit
b023d61b52
3 changed files with 6 additions and 6 deletions
  1. +2
    -2
      tricircle/db/migrate_repo/versions/004_fix_resource_routings_pod_id_length.py
  2. +2
    -2
      tricircle/db/migrate_repo/versions/005_fix_cached_endpoints_pod_id_length.py
  3. +2
    -2
      tricircle/db/migrate_repo/versions/008_fix_shadow_agents_pod_id_length.py

+ 2
- 2
tricircle/db/migrate_repo/versions/004_fix_resource_routings_pod_id_length.py View File

@ -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


+ 2
- 2
tricircle/db/migrate_repo/versions/005_fix_cached_endpoints_pod_id_length.py View File

@ -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


+ 2
- 2
tricircle/db/migrate_repo/versions/008_fix_shadow_agents_pod_id_length.py View File

@ -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


Loading…
Cancel
Save