Ticket #60: PBSQuery_torque5_ranges_fix_exechosts_split.patch

File PBSQuery_torque5_ranges_fix_exechosts_split.patch, 1.1 KB (added by stijn.deweirdt@…, 9 years ago)
  • src/PBSQuery.py

    old new  
    483483        if not nodes:
    484484            return list()
    485485
    486         if isinstance(nodes, str):
    487             nodelist = string.split(nodes,'+')
    488         else:
    489             nodelist = []
    490             for n in nodes:
    491                 if REG_SUBRANGE.search(n):
    492                     # This is a range split by _list_2_dict in a list
    493                     # E.g. exec_host node1/4,5,8-9 is after _list_dict ['node1/4', '5', '8-9']
    494                     # Re-join them with the last node
    495                     nodelist[-1] += ',%s' % n
    496                 else:
    497                     nodelist.extend(n.split('+'))
     486        if not isinstance(nodes, str):
     487            # reassemble the split from _list_2_dict
     488            # which results in things like nodes = ['nx/1','2','3+ny/4-6','8']
     489            nodes = ",".join(nodes)
     490       
     491        nodelist = string.split(nodes, '+')
    498492
    499493        res=[]
    500494        for n in nodelist: