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

Fixes #23498 - run with mongo 3.4 from scl #179

Merged
merged 1 commit into from May 17, 2018

Conversation

mbacovsky
Copy link
Member

To get version of the db server (may be remote) we assume the
'mongo' command is always available. If there is only mongo from SCL
present the mongo client has to be called from within a scl.

With current state of things it is safe to assume there is at least
some mongo client installed. For the future We will need to figure out
how to install a correct version of the client.

@iNecas
Copy link
Member

iNecas commented May 16, 2018

ACK codewise. alda519 mind testing to check it fixes the issue for you?

@alda519
Copy link
Contributor

alda519 commented May 16, 2018

Sure.
And it does. But there is one more problem - if the mongo service is down, then server_version cannot connect to it to get the version.
What about simplifying it, and use @core = available_core directly? But I am not sure if we can rely on that the server is the same version as client and what happens to mongo 2.6 packages after upgrade to 3.4)

@mbacovsky
Copy link
Member Author

@alda519 that is my plan. I'll try to guess version from the running server with fallback to the installed packages (aka available_core) as you suggest. The only issue to solve is that there could be more mongo versions installed and we can not tell what is used when the service is down. I'll update this PR with the fix.

@mbacovsky
Copy link
Member Author

@alda519 could you please re-test?

@alda519
Copy link
Contributor

alda519 commented May 17, 2018

Yup, now it works when mongo is down. Perfect.

@iNecas
Copy link
Member

iNecas commented May 17, 2018

One last thing: rubocop is not happy. Going to merge after that's resolved.

To get version of the db server (may be remote) we assume the
'mongo' command is always available. If there is only mongo from SCL
present the mongo client has to be called from  within a scl.

With current state of things it is safe to assume there is at least
some mongo client installed. For the future We will need to figure out
how to install a correct version of the client.
@mbacovsky
Copy link
Member Author

@iNecas rubocop seems satisfied now.

@iNecas iNecas merged commit 3b7d325 into theforeman:master May 17, 2018
@iNecas
Copy link
Member

iNecas commented May 17, 2018

Thanks @mbacovsky

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

Successfully merging this pull request may close these issues.

None yet

4 participants