How to use the asu.app.cli.command function in asu

To help you get started, we’ve selected a few asu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.cli.command()
def run_worker():
    """Run worker doing all sorts of background work"""
    from asu.utils.garbagecollector import GarbageCollector
    from asu.utils.boss import Boss
    from asu.utils.updater import Updater

    logging.basicConfig(level=logging.DEBUG)
    log = logging.getLogger(__name__)

    log.info("start garbage collector")
    gaco = GarbageCollector()
    gaco.start()

    log.info("start boss")
    boss = Boss()
    boss.start()
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.cli.command()
def build_worker():
    """Build image with worker package preinstalled"""
    log.info("build worker image")
    packages = [
        "bash",
        "bzip2",
        "coreutils",
        "coreutils-stat",
        "diffutils",
        "file",
        "gawk",
        "gcc",
        "getopt",
        "git",
        "libncurses",
        "make",
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.cli.command()
def build_all():
    """Build all profiles of openwrt latest stable"""
    for profile in database.get_all_profiles(
        "openwrt", config.get("openwrt").get("latest")
    ):
        target, profile = profile
        params = {
            "distro": "openwrt",
            "version": config.get("openwrt").get("latest"),
            "target": target,
            "profile": profile,
        }
        params["request_hash"] = get_request_hash(params)
        database.insert_dict("requests", params)
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.cli.command()
def loaddb():
    """Fill database with content"""
    fetch_targets()
    load_tables()
    insert_board_rename()
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.cli.command()
def initdb():
    """Initiate database with tables.sql"""
    database.init_db()