4 Send all Repair Failed hosts that the user running this script has access to
5 back into Verifying. (Only hosts ACL accessable to the user)
7 Suggested use: Run this as an occasional cron job to re-check if Repair Failed
8 hosts have overcome whatever issue caused the failure and are useful again.
11 import optparse
, os
, sys
14 from autotest_lib
.server
import frontend
18 parser
= optparse
.OptionParser(usage
='%prog [options]\n\n' +
20 parser
.add_option('-w', dest
='server', default
='autotest',
21 help='Hostname of the autotest frontend RPC server.')
22 parser
.add_option('-b', dest
='label', default
=None, type=str,
23 help='A label to restrict the set of hosts reverified.')
24 options
, unused_args
= parser
.parse_args(sys
.argv
)
26 afe_client
= frontend
.AFE(debug
=False, server
=options
.server
)
27 hostnames
= afe_client
.reverify_hosts(status
='Repair Failed',
29 # The old RPC interface didn't return anything.
30 # A more recent one returns a list of hostnames to make this message useful.
32 print 'The following Repair Failed hosts on', options
.server
,
33 print 'will be reverified:'
34 print ' '.join(hostnames
)
36 print 'Repair Failed hosts on', options
.server
, 'will be reverified.'
39 if __name__
== '__main__':