X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=policy.py;h=26187ddc4dbf32b2c4bc5dce19d4be5f538f75c2;hb=19414270cf2c8429daab02fdebbd8081d9ba0db0;hp=027da355ca1a766d39b7de691bf01d4ec72d5511;hpb=c3f2afdc81c6711c3825c82e2cd4970671575438;p=monitor.git diff --git a/policy.py b/policy.py index 027da35..26187dd 100644 --- a/policy.py +++ b/policy.py @@ -21,7 +21,7 @@ import os import reboot import database import string -from www.printbadnodes import cmpCategoryVal +from unified_model import cmpCategoryVal import config DAT="./monitor.dat" @@ -85,15 +85,6 @@ def getdebug(): def print_stats(key, stats): if key in stats: print "%20s : %d" % (key, stats[key]) -def get_ticket_id(record): - if 'ticket_id' in record and record['ticket_id'] is not "" and record['ticket_id'] is not None: - return record['ticket_id'] - elif 'found_rt_ticket' in record and \ - record['found_rt_ticket'] is not "" and \ - record['found_rt_ticket'] is not None: - return record['found_rt_ticket'] - else: - return None class Merge(Thread): def __init__(self, l_merge, toRT): @@ -927,17 +918,7 @@ class BackoffActions(SiteAction): # TODO: create class for each action below, # allow for lists of actions to be performed... -def close_rt_backoff(args): - if 'ticket_id' in args and (args['ticket_id'] != "" and args['ticket_id'] != None): - mailer.closeTicketViaRT(args['ticket_id'], - "Ticket CLOSED automatically by SiteAssist.") - plc.enableSlices(args['hostname']) - plc.enableSliceCreation(args['hostname']) - return -def reboot_node(args): - host = args['hostname'] - return reboot.reboot_policy(host, True, config.debug) def reset_nodemanager(args): os.system("ssh root@%s /sbin/service nm restart" % nodename)