Skip to content

Commit

Permalink
Catch exception on unreported service; minor formatting cleanups. #1370
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeit-internet2 committed Jan 9, 2024
1 parent 8b3c08d commit d407740
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pscheduler-core/pscheduler-core/troubleshoot
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pscheduler.set_graceful_exit()
#

class VerbatimParser(optparse.OptionParser):
return self.epilog
return self.epilog

opt_parser = VerbatimParser(
usage="Usage: %prog [ OPTIONS ] host",
Expand Down Expand Up @@ -233,7 +233,7 @@ def check_service_status(api):
pscheduler.api_url(host, "status"),
throw=False)
if http_status != 200:
failed(status)
failed(status)
if status is None:
failed("Server did not provide full status.")
ok()
Expand All @@ -243,9 +243,9 @@ def check_service_status(api):
failed("Server did not provide service status")

for service, name in services:
service_status = status["services"][service]
progress(name)
try:
service_status = status["services"][service]
if service_status["overdue"] is not None:
failed("The %s service does not appear to be running." % name)
except KeyError:
Expand Down Expand Up @@ -442,7 +442,7 @@ def run_task(message, lead, task, bind=None):
print("Performing basic troubleshooting of %s." \
% (" and ".join(hosts)))





Expand All @@ -466,7 +466,7 @@ for host in hosts:
up, reason = pscheduler.api_ping(host)
if up:
ok()
else:
else:
failed(reason.strip())


Expand All @@ -476,7 +476,7 @@ for host in hosts:
throw=False)
if status != 200:
failed(api)
ok(api)
ok(api)


start(" Checking clock")
Expand Down Expand Up @@ -607,7 +607,7 @@ try:
- pscheduler.iso8601_as_datetime(clocks[host_z]["time"])

clock_difference = pscheduler.timedelta_as_seconds(time_diff)
except (KeyError):
except KeyError:
failed("Clock tests did not yield a valid result.")

if clock_difference > 1.0:
Expand Down

0 comments on commit d407740

Please sign in to comment.