Skip to content

Commit

Permalink
Remove the duplicate subcommand
Browse files Browse the repository at this point in the history
This was previously deprecated and we received no feedback to keep it
in.
I also updated the podman python binding to the newly active name.
  • Loading branch information
JacobCallahan committed Apr 15, 2024
1 parent ae07c9c commit 32093e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ broker --output-file inventory.json inventory

**Run Broker in the background**

Certain Broker actions can be run in the background, these currently are: checkout, checkin, duplicate, and execute. When running a command in this mode, it will spin up a new Broker process and no longer log to stderr. To check progress, you can still follow broker's log file.
Certain Broker actions can be run in the background, these currently are: checkout, checkin, and execute. When running a command in this mode, it will spin up a new Broker process and no longer log to stderr. To check progress, you can still follow broker's log file.
Note that background mode will interfere with output options for execute since it won't be able to print to stdout. Those should kept in log mode.
```
broker checkout --background --nick rhel7
Expand Down
32 changes: 0 additions & 32 deletions broker/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,38 +306,6 @@ def extend(vm, background, all_, sequential, filter, **kwargs):
Broker(hosts=to_extend, **broker_args).extend(sequential=sequential)


@loggedcli()
@click.argument("vm", type=str, nargs=-1)
@click.option("-b", "--background", is_flag=True, help="Run duplicate in the background")
@click.option("-c", "--count", type=int, help="Number of times broker repeats the duplicate")
@click.option("--all", "all_", is_flag=True, help="Select all VMs")
@click.option("--filter", type=str, help="Duplicate only what matches the specified filter")
def duplicate(vm, background, count, all_, filter):
"""Duplicate a broker-procured vm.
DEPRECATED! This will be removed in Broker 0.5. If you need this feature, please open an issue.
COMMAND: broker duplicate <vm hostname>|<local id>|all
"""
logger.warning(
"Duplicate will be remove in Broker 0.5. If you need this feature, please open an issue."
)
if background:
helpers.fork_broker()
inventory = helpers.load_inventory(filter=filter)
for num, host in enumerate(inventory):
if str(num) in vm or host["hostname"] in vm or host.get("name") in vm or all_:
broker_args = host.get("_broker_args")
if broker_args:
if count:
broker_args["_count"] = count
logger.info(f"Duplicating: {host['hostname']}")
broker_inst = Broker(**broker_args)
broker_inst.checkout()
else:
logger.warning(f"Unable to duplicate {host['hostname']}, no _broker_args found")


@loggedcli(context_settings={"allow_extra_args": True, "ignore_unknown_options": True})
@click.option("-b", "--background", is_flag=True, help="Run execute in the background")
@click.option("--nick", type=str, help="Use a nickname defined in your settings")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ docker = [
"docker",
"paramiko"
]
podman = ["podman-py"]
podman = ["podman"]
setup = [
"build",
"twine",
Expand Down

0 comments on commit 32093e5

Please sign in to comment.