Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

refs #7264 - check for java, unless installing for capsule #110

Merged
merged 2 commits into from Aug 27, 2014

Conversation

bbuckingham
Copy link
Member

This commit moves the java check from a check to a hook, so that
we can more easily differentiate the behavior for a capsule vs
server install. In addition, if the installer is being run for
the capsule, skip the java check, since the capsule does not require
it.

@mccun934
Copy link
Member

Tested this to ensure we also bail if you have the IBM JVM installed. Works perfectly.

Talked to @bbuckingham via IRC and mentioned dumping the conflicting package names in the error message so the user knows exactly what is causing the conflict.

If that proves difficult, ACK to the above

@bbuckingham
Copy link
Member Author

Currently, we are determining the installed version using 'java -version'. Since that doesn't translate well to the rpm name that is in use, the PR was updated to inform the user to perform 'java -version' to get more details on what is currently installed. The user should be able to tell visually which flavor (ibm, openjdk...etc) of java is installed along with the version.

@mccun934
Copy link
Member

👍

kafo.class.exit code
end

unless param('capsule', 'pulp') && param('capsule', 'pulp').value
Copy link
Member

Choose a reason for hiding this comment

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

I may be interpreting this wrong, but isn't this saying if we are deploying a capsule without a Pulp node do a version check of Java? What happens if I am deploying just a TFTP Capsule?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ehelms, we should apply this to any capsule. What is the proper way to identify this as a capsule install?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ehelms, would checking "param('capsule')" accomplish that? (i.e apply this hook to any capsule install)

Copy link
Member

Choose a reason for hiding this comment

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

That should do it.
On Aug 26, 2014 6:43 PM, "Brad Buckingham" notifications@github.com wrote:

In hooks/pre/15-check_java.rb:

@@ -0,0 +1,24 @@
+JAVA_VERSION = %q(An OpenJDK version of Java greater than 1.7 should be installed. For more details on the version currently installed, run 'java -version')
+
+OPENJDK = %q(A version of java which is not OpenJDK is installed.
+
+Please install an OpenJDK version greater than 1.7. For more details on the version currently installed, run 'java -version')
+
+
+def error_exit(message, code)

  • $stderr.puts message
  • kafo.class.exit code
    +end

+unless param('capsule', 'pulp') && param('capsule', 'pulp').value

@ehelms https://github.com/ehelms, would checking "param('capsule')"
accomplish that? (i.e apply this hook to any capsule install)


Reply to this email directly or view it on GitHub
https://github.com/Katello/katello-installer/pull/110/files#r16747669.

Copy link
Member

Choose a reason for hiding this comment

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

Although, you may need to also check that Katello exists to identify a
server install.
On Aug 26, 2014 6:49 PM, "Eric D Helms" eric.d.helms@gmail.com wrote:

That should do it.
On Aug 26, 2014 6:43 PM, "Brad Buckingham" notifications@github.com
wrote:

In hooks/pre/15-check_java.rb:

@@ -0,0 +1,24 @@
+JAVA_VERSION = %q(An OpenJDK version of Java greater than 1.7 should be installed. For more details on the version currently installed, run 'java -version')
+
+OPENJDK = %q(A version of java which is not OpenJDK is installed.
+
+Please install an OpenJDK version greater than 1.7. For more details on the version currently installed, run 'java -version')
+
+
+def error_exit(message, code)

  • $stderr.puts message
  • kafo.class.exit code
    +end

+unless param('capsule', 'pulp') && param('capsule', 'pulp').value

@ehelms https://github.com/ehelms, would checking "param('capsule')"
accomplish that? (i.e apply this hook to any capsule install)


Reply to this email directly or view it on GitHub
https://github.com/Katello/katello-installer/pull/110/files#r16747669.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ehelms, it looks like https://github.com/Katello/katello-installer/blob/master/hooks/post/10-post_install.rb#L9 (module_enabled?) might be a reasonable alternative as well. Going to test with that approach.and will update the PR in the morning when I complete the tests. Thanks for the feedback.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to use module_enabled?('katello'). The result is that we'll only check for java, when katello is enabled (i.e. server install).

…lasticsearch

This commit moves the java check from a check to a hook, so that
we can more easily differentiate the behavior for a capsule vs
server install.  In addition, if the installer is being run for
the capsule, skip the java check, since the capsule does not require
it.

This commit is also updating the elasticsearch module to address
the second item raised by issue 7264.
@ehelms
Copy link
Member

ehelms commented Aug 27, 2014

LGTM

@jlsherrill
Copy link
Member

ACK

@mccun934
Copy link
Member

re-tested, works perfectly

mccun934 added a commit that referenced this pull request Aug 27, 2014
refs #7264 - check for java, unless installing for capsule
@mccun934 mccun934 merged commit f848d64 into Katello:master Aug 27, 2014
zjhuntin pushed a commit to zjhuntin/katello-installer that referenced this pull request Oct 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants