@@ -23,7 +23,8 @@ def pg_isready():
23
23
"""
24
24
output = subprocess .run (['pg_isready' , '-U' , 'root' ],
25
25
text = True ,
26
- capture_output = True )
26
+ capture_output = True ,
27
+ check = False )
27
28
code = output .returncode
28
29
if code == 3 :
29
30
err = 'Postgres check is misconfigured. Exiting.'
@@ -119,10 +120,9 @@ def run_sqitch_prep(paths):
119
120
LOGGER .error ('Loading Sqitch schema failed. pgosm schema will not be included in output.' )
120
121
LOGGER .error (output .stderr )
121
122
return False
122
- else :
123
- LOGGER .debug (f'Output from Sqitch: { output .stdout } ' )
124
123
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' )
126
126
output = subprocess .run (cmds_roads ,
127
127
text = True ,
128
128
capture_output = True ,
@@ -132,9 +132,8 @@ def run_sqitch_prep(paths):
132
132
LOGGER .error ('Loading roads helper data failed. Check output' )
133
133
LOGGER .error (output .stderr )
134
134
return False
135
- else :
136
- LOGGER .debug (f'Output from loading roads: { output .stdout } ' )
137
135
136
+ LOGGER .debug (f'Output from loading roads: { output .stdout } ' )
138
137
LOGGER .info ('Sqitch deployment complete' )
139
138
return True
140
139
@@ -155,11 +154,11 @@ def load_qgis_styles(paths):
155
154
'qgis-style' ,
156
155
'_load_layer_styles.sql' )
157
156
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 ()
160
159
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 ()
163
162
164
163
with get_db_conn (db_name = 'pgosm' ) as conn :
165
164
cur = conn .cursor ()
@@ -377,4 +376,3 @@ def fix_pg_dump_create_public(export_path):
377
376
export_path )
378
377
LOGGER .debug ('Completed replacement to not fail when public schema exists' )
379
378
LOGGER .debug (result )
380
-
0 commit comments