Commits

Andrew McNichols authored 97b05b3f73b
Update pipeline/repack.py (PIPE-2367)

Improve log output of EOP exception handling
No tags

pipeline/repack.py

Modified
128 128 leap = casa_full_dir +"/lib/py/lib/python" + py_ver + "/site-packages/astropy/utils/iers/data/Leap_Second.dat"
129 129 try:
130 130 print("Updating earth orientation parameters")
131 131 print(eop)
132 132 print(leap)
133 133 os.remove(eop)
134 134 os.remove(leap)
135 135 # Download new data files
136 136 urllib.request.urlretrieve("https://hpiers.obspm.fr/iers/eop/eopc04/eopc04_IAU2000.62-now", eop)
137 137 urllib.request.urlretrieve("https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat", leap)
138 - except (TypeError, FileNotFoundError):
138 + except (TypeError, FileNotFoundError) as err:
139 139 # eopc04_IAU2000.62-now was replaced by eopc04.1962-now in astropy 5.3
140 140 # that hardcoded location of Leap_Second.dat similarly superseded in 6.x
141 - print("Caught TypeError, earth orientation parameters unchanged")
141 + print("Caught exception during earth orientation parameter updates")
142 + print(str(err))
143 + print("Proceeding...")
142 144
143 145 # Install pipeline
144 146 cmd = ( casa_full_dir + "/bin/pip3 install .")
145 147 shell.runshell(cmd.split(), work_dir + "/pipeline", env)
146 148
147 149 # Create symlink, in from expected by runvlapipeline.py as used by SSA
148 150 cmd = ["find", ".","-name", "site-packages*"]
149 151 pipelinedir = subprocess.check_output(cmd, cwd=(casa_full_dir)).decode("utf-8").strip()
150 152 print("Pipeline directory: " + pipelinedir)
151 153 cmd = "ln -s " + pipelinedir + " pipeline "
268 270 leap = find("Leap_Second.dat", casa_full_dir)
269 271 try:
270 272 print("Updating earth orientation parameters")
271 273 print(eop)
272 274 print(leap)
273 275 os.remove(eop)
274 276 os.remove(leap)
275 277 # Download new data files
276 278 urllib.request.urlretrieve("https://hpiers.obspm.fr/iers/eop/eopc04/eopc04_IAU2000.62-now", eop)
277 279 urllib.request.urlretrieve("https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat", leap)
278 - except (TypeError, FileNotFoundError):
280 + except (TypeError, FileNotFoundError) as err:
279 281 # eopc04_IAU2000.62-now was replaced by eopc04.1962-now in astropy 5.3
280 282 # that hardcoded location of Leap_Second.dat similarly superseded in 6.x
281 - print("Caught TypeError, earth orientation parameters unchanged")
283 + print("Caught exception during earth orientation parameter updates")
284 + print(str(err))
285 + print("Proceeding...")
282 286
283 287 # Install pipeline
284 288 cmd = ( casa_full_dir + "/Contents/MacOS/pip3 install .")
285 289 shell.runshell(cmd.split(), work_dir + "/pipeline", env)
286 290
287 291 old_name = os.path.basename(casa_pkg)
288 292 old_name_elems = old_name.split("-")
289 293 tail ="-".join(old_name_elems[2:len(old_name_elems)])
290 294 new_name = old_name_elems[0] + "-" + old_name_elems[1] + "-pipeline-" + last_tag + "-" +tail
291 295 print ("New package name: " + new_name)

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut