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)
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)
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)
def CartPullCommand(args): # pragma: no cover jc = JuicerCommand(args) cart = juicer.cart.Cart(jc.args.cartname, autoload=False, autosave=False, autosync=False) cart.pull()
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])
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)
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)
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)
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)
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)
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)
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))
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)
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)
def CartShowCommand(args): # pragma: no cover jc = JuicerCommand(args) cart = juicer.cart.Cart(jc.args.cartname, autoload=True) jc.output.info(str(cart))
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)
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)
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)
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)