示例#1
0
def activate():
    config = updateConfig("update")
    if config.disabled:
        logger.warning("Plugin UpdateMgr: disabled by configuration.")
        return False
    if not updateDatabase().activate(config):
        logger.error("UpdateMgr database not activated")
        return False
    return True
示例#2
0
文件: __init__.py 项目: zentyal/mmc
def activate():
    config = updateConfig("update")
    if config.disabled:
        logger.warning("Plugin UpdateMgr: disabled by configuration.")
        return False
    if not updateDatabase().activate(config):
        logger.error("UpdateMgr database not activated")
        return False
    # Add create update commands in the task manager
    if config.enable_update_commands:
        TaskManager().addTask("update.create_update_commands",
                            (create_update_commands,),
                            cron_expression=config.update_commands_cron)
    return True
示例#3
0
def activate():
    config = updateConfig("update")
    if config.disabled:
        logger.warning("Plugin UpdateMgr: disabled by configuration.")
        return False
    if not updateDatabase().activate(config):
        logger.error("UpdateMgr database not activated")
        return False

    DashboardManager().register_panel(Panel('product_updates'))

    # Add create update commands in the task manager
    if config.enable_update_commands:
        TaskManager().addTask("update.create_update_commands",
                              (create_update_commands, ),
                              cron_expression=config.update_commands_cron)
    return True
示例#4
0
文件: __init__.py 项目: pruebagit/mmc
def activate():
    config = updateConfig("update")
    if config.disabled:
        logger.warning("Plugin UpdateMgr: disabled by configuration.")
        return False
    if not updateDatabase().activate(config):
        logger.error("UpdateMgr database not activated")
        return False

    DashboardManager().register_panel(Panel('product_updates'))
    DashboardManager().register_panel(Panel('clients_updates'))

    # Add create update commands in the task manager
    if config.enable_update_commands:
        TaskManager().addTask("update.create_update_commands",
                              (create_update_commands,),
                              cron_expression=config.update_commands_cron)
    if config.enable_update_description:
        TaskManager().addTask("add_update_description",
                              (add_update_description,),
                              cron_expression=config.add_update_description_cron)
    return True