#!/usr/bin/python
# -*- coding: latin-1 -*-

import os, sys, systemMgr
from logMgr import addLogRecord,CRITICAL,ERROR,WARNING,INFO,DEBUG

def demo():
    """
    arg 1 is generally 0, for multiple queries use the return value of systemMgr.openSysInfo()
        e.g.:
        tok=systemMgr.openSysInfo()
        systemMgr.queryProperty(tok, ...)
        systemMgr.queryProperty(tok, ...)
        systemMgr.closeSysInfo(tok)
    arg 2 is SOURCE
    arg 3 is NAME
    arg 4 is VALUE, a null string for returning the current value.
    arg 5 is an optional dictionary of qualifying attributes
    """
    ret, value = systemMgr.queryProperty(0,'IntelBIOSID','BoardFamilyID','',{})
    if value and ret == 0:
        print "Intel Board Family: %s" % value
        if value == 'S3000':
            print "doing something for a S3000 system"
        else:
            print "doing something for a system other than a S3000"
    if ret:
        addLogRecord(0,__name__, WARNING,'Intel board family not found: status = %d'%(ret))
    return ret

if __name__ == '__main__':
    sys.exit(demo())
