Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 21, 2017
Merged

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

merged 1 commit into from Nov 21, 2017

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.

None yet

2 participants