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

Refactor to psutil #2, added tests #95

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

Conversation

rsiera
Copy link
Contributor

@rsiera rsiera commented Aug 15, 2017

Issue: #60

Second part of refactoring to psutil. Includes tests and separating logic into classes which try not to break single object responsibility principle. This commit is preparation for last PR, which finally introduces psutil and makes pg_view platform independent.

@alexeyklyukin
Copy link
Contributor

Hi @rsiera, thank you for the PR, I will take a look at it.

cluster = db_client.establish_user_defined_connection(instance, clusters)
except (NotConnectedError, NoPidConnectionError):
logger.error('failed to acquire details about the database cluster {0}, the server '
'will be skipped'.format(instance))
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker, but this is really not an improvement over the old version. Error messages should not be broken into multiple lines for grep-ability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point

logger.error('duplicate connection options detected for databases {0} and {1}, '
'same pid {2}, skipping {0}'.format(instance, duplicate_instance, pid))
pgcon.close()
raise DuplicatedConnectionError
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why raise this as an error if all we do is ignore it?

@a1exsh
Copy link
Member

a1exsh commented Nov 16, 2017

Wow, this is still a lot of changes. Unfortunately, it takes more time to review this than I can allocate currently.

@rsiera
Copy link
Contributor Author

rsiera commented Jul 12, 2018

Hello guys, can we back to this PR and finish the review process of that, so I can fix/apply changes ? I'm aware that it's quite big PR but these tests should make the project more stable and editable. + it finally solves #60 ;)

@alexeyklyukin
Copy link
Contributor

@rsiera sorry, yes, that's a lot of code. Let me try to give it another shot in the upcoming days.

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.

4 participants