Skip to content

FIX #284 Fixing double output when no password provided#285

Merged
vnitinv merged 1 commit intoJuniper:masterfrom
maxdevyatov:master
Nov 21, 2017
Merged

FIX #284 Fixing double output when no password provided#285
vnitinv merged 1 commit intoJuniper:masterfrom
maxdevyatov:master

Conversation

@maxdevyatov
Copy link

Fix #284

After it hits ConnectAuthError with password is None it calls connect second time from the beginning with updated arguments.
There is no need to do the rest of the initial call, but it needs to return the result. So return added.

def connect(self, hostname, username, password, output_file,
                config_data=None, action=None, post_snap=None, **kwargs):
...
...
except ConnectAuthError as ex:
                if password is None and action is None:
                    password = getpass.getpass(
                        "\nEnter Password for username <%s> : " %
                        username)
                    self.connect(
                        hostname,
                        username,
                        password,
                        output_file,
                        config_data,
                        action,
                        post_snap,
                        **kwargs)
....

@vnitinv vnitinv merged commit 0e60d3f into Juniper:master Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants