Skip to content

Commit 81cc88c

Browse files
committed
Remove redundant recoding, other pylint cleanup
1 parent 346c4c2 commit 81cc88c

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

docker/db.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def pg_isready():
2323
"""
2424
output = subprocess.run(['pg_isready', '-U', 'root'],
2525
text=True,
26-
capture_output=True)
26+
capture_output=True,
27+
check=False)
2728
code = output.returncode
2829
if code == 3:
2930
err = 'Postgres check is misconfigured. Exiting.'
@@ -119,10 +120,9 @@ def run_sqitch_prep(paths):
119120
LOGGER.error('Loading Sqitch schema failed. pgosm schema will not be included in output.')
120121
LOGGER.error(output.stderr)
121122
return False
122-
else:
123-
LOGGER.debug(f'Output from Sqitch: {output.stdout}')
124123

125-
LOGGER.debug('Loading US Roads helper data')
124+
LOGGER.debug(f'Output from Sqitch: {output.stdout}')
125+
LOGGER.info('Loading US Roads helper data')
126126
output = subprocess.run(cmds_roads,
127127
text=True,
128128
capture_output=True,
@@ -132,9 +132,8 @@ def run_sqitch_prep(paths):
132132
LOGGER.error('Loading roads helper data failed. Check output')
133133
LOGGER.error(output.stderr)
134134
return False
135-
else:
136-
LOGGER.debug(f'Output from loading roads: {output.stdout}')
137135

136+
LOGGER.debug(f'Output from loading roads: {output.stdout}')
138137
LOGGER.info('Sqitch deployment complete')
139138
return True
140139

@@ -155,11 +154,11 @@ def load_qgis_styles(paths):
155154
'qgis-style',
156155
'_load_layer_styles.sql')
157156

158-
with open(create_path, 'r') as f:
159-
create_sql = f.read()
157+
with open(create_path, 'r') as file_in:
158+
create_sql = file_in.read()
160159

161-
with open(load_path, 'r') as f:
162-
load_sql = f.read()
160+
with open(load_path, 'r') as file_in:
161+
load_sql = file_in.read()
163162

164163
with get_db_conn(db_name='pgosm') as conn:
165164
cur = conn.cursor()
@@ -377,4 +376,3 @@ def fix_pg_dump_create_public(export_path):
377376
export_path)
378377
LOGGER.debug('Completed replacement to not fail when public schema exists')
379378
LOGGER.debug(result)
380-

docker/pgosm_flex.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,6 @@ def get_osm2pgsql_command(region, subregion, ram, layerset, paths):
539539
rec_cmd : str
540540
osm2pgsql command recommended by the API
541541
"""
542-
if subregion is None:
543-
region = region
544-
else:
545-
region = subregion
546-
547542
pbf_filename = get_region_filename(region, subregion)
548543
rec_cmd = rec.osm2pgsql_recommendation(ram=ram,
549544
layerset=layerset,

0 commit comments

Comments
 (0)