Changeset 14256 for fact/tools
- Timestamp:
- 07/12/12 06:40:22 (12 years ago)
- Location:
- fact/tools/PyDimCtrl
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/PyDimCtrl/factdimserver.py
r14254 r14256 16 16 17 17 # using this line makes 'export DIM_DNS_NODE=daq' obsolete 18 pydim.dic_set_dns_node(' daq')18 pydim.dic_set_dns_node('localhost') 19 19 20 20 class FactDimServer( object ): … … 51 51 time.sleep(0.5) 52 52 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) 54 54 55 55 … … 64 64 time.sleep(0.5) 65 65 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 68 70 69 71 … … 224 226 def ParseDnsServerList(): 225 227 # 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 227 233 # the output needs to be treated a bit .. it is a tuple with only one long string in it 228 234 # the string contains | and the strange character \x00 … … 253 259 for server in servers: 254 260 # 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) 256 265 # print server 257 266 # print sl_raw … … 261 270 # a note, that therer was no SERVICE_DESC ... 262 271 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) 264 276 else: 265 277 sd_raw = '' … … 309 321 return services, dd 310 322 311 323 print 'requesting and parsing DIM DNS server list' 312 324 servers = ParseDnsServerList() 325 print '... parsing each servers service list' 313 326 services, dd = ParseServersServiceList( servers ) 314 327 328 print 'creating classes' 315 329 # create one class for each Fact Dim Server 316 330 FactDimServerClasses = [] … … 339 353 # all the ServerClass instances are collected in a list 340 354 # so one can get a quick overview --> print dims 355 print 'creating an instance of each FACT DIM server' 356 341 357 dims = [] 358 new_instance = None 342 359 for i,server_name in enumerate(servers): 343 360 if server_name == 'DIS_DNS': … … 348 365 del new_instance 349 366 del i 367 368 print '.... fact DIM servers are ready to use' 350 369 ############################################################################## 351 370 # class for colored printing
Note:
See TracChangeset
for help on using the changeset viewer.