Changeset 14256


Ignore:
Timestamp:
07/12/12 06:40:22 (12 years ago)
Author:
neise
Message:
factdimserver has more timeouts and the eventviewer is coming
Location:
fact/tools/PyDimCtrl
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/PyDimCtrl/factdimserver.py

    r14254 r14256  
    1616
    1717# using this line makes 'export DIM_DNS_NODE=daq' obsolete
    18 pydim.dic_set_dns_node('daq')
     18pydim.dic_set_dns_node('localhost')
    1919
    2020class FactDimServer( object ):
     
    5151            time.sleep(0.5)
    5252        self.__last_cmd_send = time.time()
    53         pydim.dic_sync_cmnd_service(cmdstr, args, desc, timeout=None)
     53        pydim.dic_sync_cmnd_service(cmdstr, args, desc, timeout=1)
    5454       
    5555
     
    6464            time.sleep(0.5)
    6565        self.__last_service_got = time.time()
    66 
    67         return pydim.dic_sync_info_service(full_srv_name, desc)
     66        print 'full_srv_name',full_srv_name
     67        print 'desc', desc
     68        return pydim.dic_sync_info_service(full_srv_name, desc, timeout=1)
     69           
    6870
    6971
     
    224226def ParseDnsServerList():
    225227    # making server list
    226     rawlist = pydim.dic_sync_info_service('DIS_DNS/SERVER_LIST','C')
     228    rawlist = pydim.dic_sync_info_service('DIS_DNS/SERVER_LIST','C', timeout=5)
     229    if rawlist == None:
     230        print "couldn't get the server list of DIS_DNS. program abortion..."
     231        sys.exit(1)
     232    print rawlist   
    227233    # the output needs to be treated a bit .. it is a tuple with only one long string in it
    228234    # the string contains | and the strange character \x00
     
    253259    for server in servers:
    254260        # sl_raw is a tuple, with an really long string, which needs to be parsed
    255         sl_raw = pydim.dic_sync_info_service(server+'/SERVICE_LIST','C')[0]
     261        sl_raw = pydim.dic_sync_info_service(server+'/SERVICE_LIST','C',timeout=3)[0]
     262        if sl_raw == None:
     263            print "couldn't get the service list of ", server, "program abortion..."
     264            sys.exit(1)
    256265#        print server
    257266#        print sl_raw
     
    261270        # a note, that therer was no SERVICE_DESC ...
    262271        if server+'/SERVICE_DESC' in sl_raw:
    263             sd_raw = pydim.dic_sync_info_service(server+'/SERVICE_DESC','C')[0]
     272            sd_raw = pydim.dic_sync_info_service(server+'/SERVICE_DESC','C',timeout=3)[0]
     273            if sd_raw == None:
     274                print "couldn't get the service description list of ", server, "program abortion..."
     275                sys.exit(1)
    264276        else:
    265277            sd_raw = ''
     
    309321    return services, dd
    310322
    311 
     323print 'requesting and parsing DIM DNS server list'
    312324servers = ParseDnsServerList()
     325print '... parsing each servers service list'
    313326services, dd = ParseServersServiceList( servers )
    314327
     328print 'creating classes'
    315329# create one class for each Fact Dim Server
    316330FactDimServerClasses = []
     
    339353# all the ServerClass instances are collected in a list
    340354# so one can get a quick overview --> print dims
     355print 'creating an instance of each FACT DIM server'
     356
    341357dims = []
     358new_instance = None
    342359for i,server_name in enumerate(servers):
    343360    if server_name == 'DIS_DNS':
     
    348365del new_instance
    349366del i
     367
     368print '.... fact DIM servers are ready to use'
    350369##############################################################################
    351370# class for colored printing
Note: See TracChangeset for help on using the changeset viewer.