Example #1
0
def RepoPublishCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_repo = juicer.pulp.Repo(jc.connections[environment])
        pulp_repo.publish(name=jc.args.repo,
                          environment=environment)
Example #2
0
def CartUpdateCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    cart = juicer.cart.Cart(jc.args.cartname, autoload=True)
    filtered_repo_items = juicer.remotes.filter_items(jc.args.r,
                                                      cart.cart_type)
    cart.update(filtered_repo_items)
Example #3
0
def RoleAddCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_role = juicer.pulp.Role(jc.connections[environment])
        pulp_role.add_user(name=jc.args.role,
                           environment=environment,
                           login=jc.args.login)
Example #4
0
def CartPullCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    cart = juicer.cart.Cart(jc.args.cartname,
                            autoload=False,
                            autosave=False,
                            autosync=False)
    cart.pull()
Example #5
0
def RPMUploadCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        jc.output.info(
            "Starting upload for {} environment".format(environment))
        cart = juicer.cart.Cart('upload-cart', jc.args.r)
        cart.upload_items(environment, jc.connections[environment])
Example #6
0
def RepoShowCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        for repo in jc.args.repo:
            pulp_repo = juicer.pulp.Repo(jc.connections[environment])
            pulp_repo.show(name=repo,
                           environment=environment,
                           json=jc.args.json)
Example #7
0
def CartCreateCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)
    filtered_repo_items = juicer.remotes.filter_items(jc.args.r,
                                                      jc.args.cart_type)
    juicer.cart.Cart(name=jc.args.cartname,
                     cart_type=jc.args.cart_type,
                     description=filtered_repo_items,
                     autosave=True,
                     force=jc.args.force)
Example #8
0
def CartPushCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    cart = juicer.cart.Cart(jc.args.cartname,
                            autoload=True,
                            autosave=True,
                            autosync=False)
    for environment in jc.args.environment:
        cart.upload_items(environment, jc.connections[environment],
                          jc.args.force)
Example #9
0
def UserUpdateCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_user = juicer.pulp.User(jc.connections[environment])
        pulp_user.update(login=jc.args.login,
                         password=jc.args.password,
                         environment=environment,
                         name=jc.args.name,
                         roles=jc.args.roles)
Example #10
0
def RPMDeleteCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_repo = juicer.pulp.Repo(jc.connections[environment])
        for repo, item in jc.args.r:
            pulp_repo.remove(name=repo,
                             environment=environment,
                             item_type='rpm',
                             glob=item)
            pulp_repo.publish(repo, 'rpm', environment)
Example #11
0
def RepoCreateCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_repo = juicer.pulp.Repo(jc.connections[environment])
        pulp_repo.create(name=jc.args.repo,
                         repotype=jc.args.repotype,
                         environment=environment,
                         checksumtype=jc.args.checksum_type)
        pulp_repo.publish(name=jc.args.repo,
                          environment=environment)
Example #12
0
def CartListCommand(args):
    jc = JuicerCommand(args)

    carts = []
    for glob in jc.args.cart_glob:
        # Translate cart names into cart file names
        if not glob.endswith('.json'):
            glob += '.json'

        for cart in _find_pattern(Constants.CART_LOCATION, glob):
            cart_name = os.path.basename(cart).replace('.json', '')
            carts.append(cart_name)
    for cart in sorted(carts):
        jc.output.info("{}".format(cart))
Example #13
0
def HelloCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp = juicer.pulp.Pulp(jc.connections[environment])
        pulp.hello(environment)
Example #14
0
def RoleListCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_role = juicer.pulp.Role(jc.connections[environment])
        pulp_role.list(environment=environment)
Example #15
0
def CartShowCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    cart = juicer.cart.Cart(jc.args.cartname, autoload=True)
    jc.output.info(str(cart))
Example #16
0
def UserListCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_user = juicer.pulp.User(jc.connections[environment])
        pulp_user.list(environment=environment)
Example #17
0
def CartDeleteCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    cart = juicer.cart.Cart(jc.args.cartname)
    cart.delete(local=jc.args.local, remote=jc.args.remote)
Example #18
0
def UserShowCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_user = juicer.pulp.User(jc.connections[environment])
        pulp_user.show(login=jc.args.login, environment=environment)
Example #19
0
def RepoListCommand(args):  # pragma: no cover
    jc = JuicerCommand(args)

    for environment in jc.args.environment:
        pulp_repo = juicer.pulp.Repo(jc.connections[environment])
        pulp_repo.list(environment=environment)