~apw/arsenal/python-launchpadlib-toolkit-task_date_accessors

« back to all changes in this revision

Viewing changes to scripts/launchpad-service-status

  • Committer: Bryce Harrington
  • Date: 2011-02-10 01:57:49 UTC
  • Revision ID: bryce@canonical.com-20110210015749-hfu9fryl5trj10w3
Install script

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
# Are we in the middle of an expected outage?
50
50
if datetime.now() > outage_start and datetime.now() < outage_end:
51
51
    print 'OFFLINE EXPECTED'
52
 
    sys.exit(2)
 
52
    sys.exit(3)
53
53
 
54
54
# Will we be offline shortly?
55
55
pending_offline_time = timedelta(hours=2)
56
56
if datetime.now() + pending_offline_time > outage_start:
57
 
    print 'OFFLINE PENDING'
58
 
    sys.exit(3)
 
57
    print 'PENDING OFFLINE'
 
58
    sys.exit(2)
59
59
 
60
60
# Can we at least reach launchpad's api service in minimal read-only mode?
61
61
try:
70
70
    print 'UP READWRITE'
71
71
except:
72
72
    print 'UP READONLY'
73
 
    raise
74
73
    sys.exit(1)
75
74
 
76
75
sys.exit(0)