Skip to content

abort_on_prompts=True aborts even when host, password are set #417

@bitprophet

Description

@bitprophet

Valerie Ishida, on the mailing list, writes:

I tried the following code...

with fabric.api.settings(host_string="testuser@localhost", user="testuser", password="testuser", abort_on_prompts=True):
    fabric.api.run("ls /tmp")

Fatal error: Needed to prompt, but abort-on-prompts was set to True!

Aborting.

But if I run...

with fabric.api.settings(host_string="testuser@localhost", user="testuser", password="testuser"):
    fabric.api.run("ls /tmp")

It runs fine and does not prompt.


This seems a legitimate bug, where the handle_prompt_aborts() call in the internal @needs_host decorator, is at the outer level, and thus fires pretty much on any network related operation.

It instead needs to fire only inside the block which prompts for a host when env.host_string is not set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions