Changeset 7164 for lliurex-statistics


Ignore:
Timestamp:
Apr 24, 2018, 1:17:12 PM (19 months ago)
Author:
mabarracus
Message:

Add ltsp subtype spec

Location:
lliurex-statistics/trunk/fuentes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lliurex-statistics/trunk/fuentes/debian/changelog

    r7163 r7164  
     1lliurex-statistics (0.5.3.3) xenial; urgency=medium
     2
     3  * Add ltsp subtype spec
     4
     5 -- M.Angel Juan <m.angel.juan@gmail.com>  Mon, 23 Apr 2018 18:27:51 +0200
     6
    17lliurex-statistics (0.5.3.2) xenial; urgency=medium
    28
  • lliurex-statistics/trunk/fuentes/lliurex-statistics.install/usr/sbin/analytics

    r6970 r7164  
    3232# DEBUG = 1
    3333
    34 MODE = 'PROCEDURAL'
    35 # MODE = 'THREADED'
     34# MODE = 'PROCEDURAL'
     35MODE = 'THREADED'
    3636
    3737CONFIGFILE = '/etc/lliurex-analytics/agent.cfg'
     
    674674    return str(arch)
    675675
     676def get_subtype():
     677    global log
     678
     679    subtype = { 'LTSP': None , 'MODE': None}
     680    try:
     681        outtype = bin_to_ascii(subprocess.check_output(['lliurex-version -a -e'],shell=True)).strip()
     682        outtype = outtype.split('\n')
     683        ltsp = None
     684        mode = None
     685        for line in outtype:
     686            if re.search('FAT=yes', line, re.IGNORECASE):
     687                mode = 'FAT'
     688            elif re.search('THIN=yes', line, re.IGNORECASE):
     689                mode = 'THIN'
     690            elif re.search('SEMI=yes', line, re.IGNORECASE):
     691                mode = 'SEMI'
     692            elif re.search('LTSP=yes', line, re.IGNORECASE):
     693                ltsp = True
     694        subtype['LTSP'] = ltsp
     695        subtype['MODE'] = mode
     696    except Exception as e:
     697        return subtype
     698    return subtype
     699
    676700
    677701def get_platform_data():
     
    684708    data.setdefault('vga', get_vga())
    685709    data.setdefault('arch', get_arch())
    686 
    687     log.debug("Detected mac='{}' arch='{}' cpu='{}' mem='{}' vga='{}'".format(data['mac'], data['arch'], data['cpu'], data['mem'], data['vga']))
     710    data.setdefault('subtype', get_subtype())
     711
     712    log.debug("Detected mac='{}' arch='{}' cpu='{}' mem='{}' vga='{}' subtype='{}'".format(data['mac'], data['arch'], data['cpu'], data['mem'], data['vga'], data['subtype']))
    688713    return data
    689714
Note: See TracChangeset for help on using the changeset viewer.