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

feature: Nicer handling of disconnects #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JJdeVries
Copy link
Collaborator

Cleanup of some common code between the two connections (ssh and telnet). Mainly reverted the locks and retries to a common class. This also adds locking to the SshConnection as there were some race issues there as well.

@kennedyshead
Copy link
Owner

It would be great if you could rebase this @JJdeVries


await self._async_connect()

async def async_disconnect(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR contain a breaking change: disconnect method is replaced by async_disconnect.
I think it should be properly highlighted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yes might have been a bit too forward with deleting the previous disconnect method. Although I'm still of the opinion it should be removed, as the lock is definitely needed to avoid nasty errors.

Probably best to re-add the disconnect method including a deprecation warning, to at least give people some time for updating.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version upgrade using py is not mandatory, imho if breaking change is required must be implemented and released without deprecation or work-around, but is important to clarify to the users what is happening. Probably is better to insert in a mayor release as suggested by @kennedyshead because breaking changes are expected.

@kennedyshead
Copy link
Owner

This one should be a start of a major version upgrade imo! We should create a devel-branch and move this to that one. It requires alfa-testing from different setups so we don't accidentally break someones system.

@kennedyshead
Copy link
Owner

@JJdeVries Can you have a quick look here just to be sure I didnt break anything when I fixed the merge-conflict? Then its good to go IMO

@JJdeVries
Copy link
Collaborator Author

@kennedyshead @Chen-IL
It seems that the commit 12717cd by @Chen-IL has changed all the line-endings in the asuswrt.py file from unix (\r\n) to dos (\n). This is rather unfortunate as now this branch has a lot of merge conflicts, and the git blame functionality is unusable as everything is now last changed by @Chen-IL .

I'm not really sure why this was not picked up during the review, as probably the entire file was shown in the diff?

Regarding this pull request. I've pushed a commit to also change the line-endings of asuswrt.py to [dos], although probably the result will be that now my name (and this specific commit) will show up in the git blame logging.

@Chen-IL please unsure you fix your editor to not overwrite the line-endings on saving the file, but to keep the current configured style.

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.

3 participants