X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=policy.py;h=26187ddc4dbf32b2c4bc5dce19d4be5f538f75c2;hp=027da355ca1a766d39b7de691bf01d4ec72d5511;hb=944d143a6528c4157b71f51ed480aec806cbaa06;hpb=94cd174f6ce0bb3b2c8bceda0346e332037c6d8a 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)