Exemplo n.º 1
0
def execute(vm, args):
    """ client side, returns (bool,*) """
    logging.debug("    BUILD %s" % args)
    assert vm, "null vm"
    assert command.context, "Null context"

    backend = command.context["backend"]
    frontend = command.context["frontend"]
    params = command.context["build_parameters"].copy()
    blacklist = command.context["blacklist"][:]
    soldierlist = command.context["soldierlist"][:]
    nointernetcheck = command.context["nointernetcheck"][:]

    report = command.context["report"]

    logging.debug("args: %s", args)
    action, platform, kind, puppet = args[0:4]

    operation = "AOP_%s" % puppet

    param = params[platform]
    platform_type = param['platform_type']

    assert kind in ['silent', 'melt'], "kind: %s" % kind
    assert action in [
        'scout', 'elite', 'elite_fast', 'soldier_fast', 'internet', 'test',
        'clean', 'pull'
    ], "action: %s" % action
    assert platform_type in ['desktop',
                             'mobile'], "platform_type: %s" % platform_type

    class Args:
        pass

    args = Args()

    args.action = action
    args.platform = platform
    args.kind = kind
    args.backend = backend
    args.frontend = frontend
    args.param = param
    args.blacklist = blacklist
    args.soldierlist = soldierlist
    args.platform_type = platform_type
    args.nointernetcheck = nointernetcheck
    args.operation = operation
    args.puppet = puppet
    args.asset_dir = "AVAgent/assets"
    args.factory = None

    results, success, errors = build.build(args, report)

    try:
        last_result = results[-1]
    except:
        last_result = "NO RESULTS"

    return success, results
Exemplo n.º 2
0
def execute(vm, args):
    """ client side, returns (bool,*) """
    logging.debug("    BUILD %s" % args)
    assert vm, "null vm"
    assert command.context, "Null context"

    backend = command.context["backend"]
    frontend = command.context["frontend"]
    params = command.context["build_parameters"].copy()
    blacklist = command.context["blacklist"][:]
    soldierlist = command.context["soldierlist"][:]
    nointernetcheck = command.context["nointernetcheck"][:]

    report = command.context["report"]

    logging.debug("args: %s", args)
    action, platform, kind, puppet = args[0:4]

    operation = "AOP_%s" % puppet

    param = params[platform]
    platform_type = param['platform_type']

    assert kind in ['silent', 'melt'], "kind: %s" % kind
    assert action in ['scout', 'elite', 'elite_fast', 'soldier_fast', 'internet', 'test', 'clean', 'pull'], "action: %s" % action
    assert platform_type in ['desktop', 'mobile'], "platform_type: %s" % platform_type


    class Args:
        pass

    args = Args()

    args.action = action
    args.platform = platform
    args.kind = kind
    args.backend = backend
    args.frontend = frontend
    args.param = param
    args.blacklist = blacklist
    args.soldierlist = soldierlist
    args.platform_type = platform_type
    args.nointernetcheck = nointernetcheck
    args.operation = operation
    args.puppet = puppet
    args.asset_dir = "AVAgent/assets"
    args.factory = None

    results, success, errors = build.build(args, report)

    try:
        last_result = results[-1]
    except:
        last_result = "NO RESULTS"

    return success, results
Exemplo n.º 3
0
def build_server(kind, platform_type, platform, srv, factory=None):
    global params


    class Args:
        pass

    report = None

    try:
        srv_params = servers[srv]
    except KeyError:
        return False


    args = Args()

    args.action = "pull"
    args.platform = platform
    args.kind = kind
    args.backend = srv_params["backend"]
    args.frontend = srv_params["frontend"]
    args.platform_type = platform_type
    args.operation = srv_params["operation"]
    args.param = params[platform_type][platform]
    args.asset_dir = "assets"

    # servono??
    args.blacklist = ""
    args.soldierlist = ""
    args.nointernetcheck = socket.gethostname()
    args.puppet = "rite"
    args.factory = factory

    build.connection.host = srv_params["backend"]
    #build.connection.user = "******"
    build.connection.passwd = "testriteP123"

    results, success, errors = build.build(args, report)
    print "after build", results, success, errors
    if success:
        return results
    else:
        return errors
Exemplo n.º 4
0
def build_server(kind, platform_type, platform, srv, factory=None):
    global params

    class Args:
        pass

    report = None

    try:
        srv_params = servers[srv]
    except KeyError:
        return False

    args = Args()

    args.action = "pull"
    args.platform = platform
    args.kind = kind
    args.backend = srv_params["backend"]
    args.frontend = srv_params["frontend"]
    args.platform_type = platform_type
    args.operation = srv_params["operation"]
    args.param = params[platform_type][platform]
    args.asset_dir = "assets"

    # servono??
    args.blacklist = ""
    args.soldierlist = ""
    args.nointernetcheck = socket.gethostname()
    args.puppet = "rite"
    args.factory = factory

    build.connection.host = srv_params["backend"]
    #build.connection.user = "******"
    build.connection.passwd = "testriteP123"

    results, success, errors = build.build(args, report)
    print "after build", results, success, errors
    if success:
        return results
    else:
        return errors