Changeset 3532

Show
Ignore:
Timestamp:
10/08/2009 10:28:23 AM (2 months ago)
Author:
brian
Message:

Make downtime plugin compatible with existing GIP installs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gip/trunk/gip/plugins/downtime.py

    r3529 r3532  
    2020default_url = "https://myosg.grid.iu.edu/rgdowntime/xml?datasource=downtime" \ 
    2121    "&all_resources=on" 
     22 
     23# If the GlueDowntime template is not available, we will fall back to these 
     24# entries.  This is done so downtime.py can be a standalone plugin on existing 
     25# GIP installs 
     26ce_template = """\ 
     27dn: GlueCEUniqueID=%(ceUniqueID)s,mds-vo-name=local,o=grid 
     28GlueCEStateStatus: %(status)s 
     29""" 
     30 
     31se_template = """\ 
     32dn: GlueSEUniqueID=%(seUniqueID)s,mds-vo-name=local,o=grid 
     33GlueSEStatus: %(status)s 
     34""" 
    2235 
    2336class Downtime(object): 
     
    189202 
    190203    def publishCEList(self): 
    191         template = getTemplate("GlueDowntime", "GlueCEUniqueID") 
     204        try: 
     205            template = getTemplate("GlueDowntime", "GlueCEUniqueID") 
     206        except: 
     207            template = ce_template 
    192208        for downtime in self.downtimes: 
    193209            if not downtime.isActive(): 
     
    200216 
    201217    def publishSEList(self): 
    202         template = getTemplate("GlueDowntime", "GlueSEUniqueID") 
     218        try: 
     219            template = getTemplate("GlueDowntime", "GlueSEUniqueID") 
     220        except: 
     221            template = se_template 
    203222        for downtime in self.downtimes: 
    204223            if not downtime.isActive(): 
     
    209228                    test_name = se[:-10] 
    210229                hostname = test_name.split(':')[0].split("/")[0] 
    211                 log.info("Checking SE %s, host %s" % (se, hostname)) 
    212230                if downtime.matchCE(hostname) or \ 
    213231                        downtime.matchResource(hostname):