Ejemplo n.º 1
0
def activate():
    logger = logging.getLogger()
    config = InventoryConfig()
    config.init("inventory")
    logger.debug("Inventory %s" % str(config.disable))
    if config.disable:
        logger.warning("Plugin inventory: disabled by configuration.")
        return False

    # When this module is used by the MMC agent, the global inventory variable is shared.
    # This means an Inventory instance is not created each time a XML-RPC call is done.
    if not InventoryLocation().init(
            config
    ):  # does Inventory().activate() (which does the Inventory().db_check())
        return False

    logger.info("Plugin inventory: Inventory database version is %d" %
                Inventory().dbversion)

    ComputerManager().register("inventory", InventoryComputers)
    ProvisioningManager().register('inventory', InventoryProvisioner)
    ComputerLocationManager().register('inventory', InventoryLocation)

    PossibleQueries().init(config)

    # Register the panel to the DashboardManager
    try:
        from mmc.plugins.dashboard.manager import DashboardManager
        from mmc.plugins.inventory.panel import InventoryPanel
        DM = DashboardManager()
        DM.register_panel(InventoryPanel("inventory"))
    except ImportError:
        pass

    return True
Ejemplo n.º 2
0
def delUser(username):
    return InventoryLocation().delUser(username)
Ejemplo n.º 3
0
def setLocationsForUser(username, attrs):
    return InventoryLocation().setLocationsForUser(username, attrs)
Ejemplo n.º 4
0
def getLocationsForUser(username):
    return InventoryLocation().getLocationsForUser(username)
Ejemplo n.º 5
0
def addEntityRule(ruleobj):
    return InventoryLocation().addEntityRule(ruleobj)
Ejemplo n.º 6
0
def deleteEntityRule(idrule):
    return InventoryLocation().deleteEntityRule(idrule)
Ejemplo n.º 7
0
def operatorTag(MappedObject):
    return InventoryLocation().operatorTag(MappedObject)
Ejemplo n.º 8
0
def operatorTagAll():
    return InventoryLocation().operatorTagAll()
Ejemplo n.º 9
0
def moveEntityRuleUp(idrule):
    return InventoryLocation().moveEntityRuleUp(idrule)
Ejemplo n.º 10
0
def operatorType():
    return InventoryLocation().operatorType()
Ejemplo n.º 11
0
def parse_file_rule(param):
    return InventoryLocation().parse_file_rule(param)
Ejemplo n.º 12
0
def deleteEntities(id, Label, parentId):
    return InventoryLocation().deleteEntities(id, Label, parentId)
Ejemplo n.º 13
0
def createLocation(name, parent_name):
    return InventoryLocation().createLocation(name, parent_name)
Ejemplo n.º 14
0
def updateEntities(id, name):
    return InventoryLocation().updateEntities(id, name)
Ejemplo n.º 15
0
def getLocationAll(params):
    return InventoryLocation().getLocationAll(params)