#!/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.countProperty(tok, ...)
        systemMgr.countProperty(tok, ...)
        systemMgr.closeSysInfo(tok)
    arg 2 is SOURCE
    arg 3 is NAME
    arg 4 is an optional dictionary of qualifying attributes
    """
    ret = systemMgr.countProperty(0,'Ethernet','MACaddress',{})
    addLogRecord(0,'countPropertyDemo.py', INFO,'%d Ethernet ports found by the OS'% ret)
    print "%d Ethernet ports found by the OS" % ret
    return ret

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