- Timestamp:
- Sep 22, 2017, 6:32:52 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r13984 r13985 50 50 import textwrap 51 51 import time 52 import traceback 52 53 import urlparse 53 54 … … 237 238 datadump[key]['autogen_iface'] = '_'.join(key.split('_')[1:]) 238 239 239 except Exception :240 print "# Error while processing interface %s" % key240 except Exception as exc: 241 exc.args = ("# Error while processing interface %s" % key,) + exc.args 241 242 raise 242 243 … … 250 251 datadump['autogen_fqdn'] = datadump['nodename'] + '.' + datadump['autogen_domain'] 251 252 datadump_cache[item] = datadump.copy() 252 except Exception :253 print "# Error while processing %s" % item253 except Exception as exc: 254 exc.args = ("# Error while processing %s" % item,) + exc.args 254 255 raise 255 256 return datadump … … 1381 1382 output += " %-11s: %s\n" % (key, format_yaml_value(datadump[iface_key][key])) 1382 1383 output += "\n\n" 1383 except Exception :1384 print "# Error while processing interface %s" % iface_key1384 except Exception as exc: 1385 exc.args = ("# Error while processing interface %s" % iface_key,) + exc.args 1385 1386 raise 1386 1387 … … 1494 1495 output += subprocess.Popen([SVN, 'cleanup', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0] 1495 1496 output += subprocess.Popen([SVN, 'up', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0] 1496 generate_static(CACHE_DIR, False) 1497 try: 1498 generate_static(CACHE_DIR, False) 1499 except: 1500 output += traceback.format_exc() 1501 pass 1497 1502 output += "[INFO] All done, redirecting in 5 seconds" 1498 1503 response_headers += [ … … 2267 2272 datadump['monitoring_group'] = 'wleiden' 2268 2273 2269 except Exception :2270 print "# Error while processing interface %s" % iface_key2274 except Exception as exc: 2275 exc.args = ("# Error while processing interface %s" % iface_key,) + exc.args 2271 2276 raise 2272 2277 store_yaml(datadump) 2273 except Exception :2274 print "# Error while processing %s" % host2278 except Exception as exc: 2279 exc.args = ("# Error while processing %s" % host,) + exc.args 2275 2280 raise 2276 2281 elif sys.argv[1] == "list":
Note:
See TracChangeset
for help on using the changeset viewer.