Skip to content

env.gateway doesn't honor the content of env.passwords #884

Description

@mnencia

The fabric.network.connect(user, host, port) function uses the function fabric.auth.get_password() to retrieve the password, and that function always return the password related to the current env.host_string.

This approach works with only one one level of connections, but when you use a env.gateway setting, the first connect host parameter will match the env.host_string content, so it will retrieve the wrong password.

Example:

from fabric.api import *

@task(default=True)
@hosts('user@host')
@with_settings(
    no_keys=True,
    gateway='gwuser@gwhost',
    passwords={
        'user@host':'pass',
        'gwuser@gwhost':'gwpass',
        }
)
def run():
    run('uname -n')

This will end to a try to log on 'gwuser@gwhost' using 'pass' as password instead of 'gwpass'.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions