Changeset 35254d1 in nscp for build/python/postbuild.py


Ignore:
Timestamp:
01/15/12 23:32:36 (2 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
89838be
Parents:
ba63b95
Message:
  • Fixed installer "back" issues
  • Fixed payload truncation for NRPe and NSCA
  • Improved the installer target tagging functions in the python installer
File:
1 edited

Legend:

Unmodified
Added
Removed
  • build/python/postbuild.py

    rd48afa1 r35254d1  
    1616vstring = version.version() 
    1717 
     18targets = None 
     19 
     20def build_targets(str): 
     21  targets = {} 
     22  for itm in str.split(';'): 
     23    tmp = itm.split('=') 
     24    if len(tmp) == 0: 
     25      continue 
     26    elif len(tmp) == 1: 
     27      targets['nscp'] = tmp[0] 
     28    else: 
     29      targets[tmp[0]] = tmp[1] 
     30  return targets 
     31       
     32   
     33     
     34def find_target(key=None): 
     35  global targets 
     36  if not targets: 
     37    targets = build_targets(TARGET_SITE) 
     38  if not key: 
     39    key = 'nscp' 
     40  if not key in targets: 
     41    return None 
     42  return targets[key] 
     43 
     44 
    1845def scp_file(file): 
    1946  tfile = os.path.basename(file) 
     
    2249  if '_' in name: 
    2350    (name, tag) = name.split('_') 
    24     if globals().has_key('TARGET_SITE_%s'%tag): 
    25       target = globals().get('TARGET_SITE_%s'%tag) 
     51    target = find_target(tag) 
     52    if target: 
    2653      print 'Found tagged installer %s for %s'%(tfile, tag) 
    2754    else: 
     
    2956  else: 
    3057    print 'Found normal installer %s'%tfile 
    31     target = TARGET_SITE 
     58    target = find_target() 
    3259  if target: 
    3360    print 'Uploading name: %s to %s'%(tfile, target) 
Note: See TracChangeset for help on using the changeset viewer.