# Buggy code
def deploy(
    general_config,
    remote_provider,
    nucypher_image,
    seed_network,
    sentry_dsn,
    wipe,
    prometheus,
    namespace,
    network,
    gas_strategy,
    include_hosts,
):
    """Deploys NuCypher on managed hosts."""

    emitter = setup_emitter(general_config)

    if not CloudDeployers:
        emitter.echo(
            "Ansible is required to use `nucypher cloudworkers *` commands.  (Please run 'pip install ansible'.)",
            color="red",
        )
        return

    deployer = CloudDeployers.get_deployer("generic")(
        emitter,
        None,
        None,
        remote_provider,
        nucypher_image,
        seed_network,
        sentry_dsn,
        prometheus=prometheus,
        namespace=namespace,
        network=network,
        gas_strategy=gas_strategy,
    )

    hostnames = deployer.config["instances"].keys()
    if include_hosts:
        hostnames = include_hosts
    for name, hostdata in [
        (n, d) for n, d in deployer.config["instances"].items() if n in hostnames
    ]:
        emitter.echo(f"\t{name}: {hostdata['publicaddress']}", color="yellow")
    deployer.deploy_nucypher_on_existing_nodes(hostnames, wipe_nucypher=wipe)


# Traceback (TypeError)
Traceback (most recent call last):
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/bin/nucypher", line 33, in <module>
sys.exit(load_entry_point('nucypher', 'console_scripts', 'nucypher')())
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/k/Git/nucypher/nucypher/cli/options.py", line 167, in wrapper
return func(**kwargs)
File "/home/k/Git/nucypher/nucypher/cli/options.py", line 167, in wrapper
return func(**kwargs)
File "/home/k/Git/nucypher/nucypher/cli/options.py", line 167, in wrapper
return func(**kwargs)
TypeError: add_for_stake() got an unexpected keyword argument 'config_file'

# Fixed code
def deploy(
    general_config,
    remote_provider,
    nucypher_image,
    seed_network,
    wipe,
    prometheus,
    namespace,
    network,
    gas_strategy,
    include_hosts,
    envvars,
):
    """Deploys NuCypher on managed hosts."""

    emitter = setup_emitter(general_config)

    if not CloudDeployers:
        emitter.echo(
            "Ansible is required to use `nucypher cloudworkers *` commands.  (Please run 'pip install ansible'.)",
            color="red",
        )
        return

    deployer = CloudDeployers.get_deployer("generic")(
        emitter,
        None,
        None,
        remote_provider,
        nucypher_image,
        seed_network,
        prometheus=prometheus,
        namespace=namespace,
        network=network,
        gas_strategy=gas_strategy,
        envvars=envvars,
    )

    hostnames = deployer.config["instances"].keys()
    if include_hosts:
        hostnames = include_hosts
    for name, hostdata in [
        (n, d) for n, d in deployer.config["instances"].items() if n in hostnames
    ]:
        emitter.echo(f"\t{name}: {hostdata['publicaddress']}", color="yellow")
    deployer.deploy_nucypher_on_existing_nodes(hostnames, wipe_nucypher=wipe)