added builder checkin script
This commit is contained in:
parent
4ae37fa48a
commit
bd79d8fb0c
1 changed files with 27 additions and 0 deletions
27
scripts/checkBuilderCheckin/checkBuilderCheckin.py
Executable file
27
scripts/checkBuilderCheckin/checkBuilderCheckin.py
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import urllib
|
||||||
|
import koji
|
||||||
|
import socket
|
||||||
|
import datetime
|
||||||
|
import time
|
||||||
|
|
||||||
|
FIVE_MIN = 300
|
||||||
|
FIFTEEN_MIN = 900
|
||||||
|
|
||||||
|
k = koji.ClientSession('https://koji.fedoraproject.org/kojihub', {})
|
||||||
|
hosts = k.listHosts()
|
||||||
|
|
||||||
|
me = socket.gethostname()
|
||||||
|
me = 'ppc3'
|
||||||
|
#k.getLastHostUpdate
|
||||||
|
for host in hosts:
|
||||||
|
if host['name'].startswith(me):
|
||||||
|
t = k.getLastHostUpdate(host['id'])
|
||||||
|
dt = time.strptime(t.split('.')[0], "%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
|
print time.time() - time.mktime(dt)
|
||||||
|
|
||||||
|
if host['ready'] == False and host['task_load'] >= host['capacity']:
|
||||||
|
print "restarting"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue