Devstack plugin requires openjdk 1.7 instead of any compatible Java 7

Bug #1467949 reported by serenico
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
networking-odl
Fix Released
Undecided
Federico Ressi

Bug Description

Fedora 21 doesn't came with openjdk1.7 package (as probably other distributions).

When executing script devstack/stack.sh the plugin script fails here:

https://github.com/openstack/networking-odl/blob/4accbfe888d1f4dfc7a381d4284480cb6ba726ba/devstack/plugin.sh#L159-L161

The script requires explicitly Openjdk package, when actually what it should check if any compatible java 7 is already installed and just use it instead.
For example on my machine I have installe Oracle JDK 7.

$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Revision history for this message
serenico (federico-ressi) wrote :
Revision history for this message
Federico Ressi (federico-ressi-9) wrote :

Ideal behaviors:

Scenario 1:

- given version of ODL requiring version of Java 7 or Java 8
- given host machine has the right Java version installed as default one

- when installing ODL dependencies (maven, java, ...)

- then don't install Java

Scenario 2:

- given version of ODL requiring version of Java 7 or Java 8
- given host machine has the wrong Java version installed as default one
- given Linux distribution provides compliant OpenJDK package

- when installing ODL dependencies (maven, java, ...)

- then install required version of provided OpenJDK package
- then make installed java the current one using update alternatives

Scenario 3:

- given version of ODL requiring version of Java 7 or Java 8
- given host machine has the wrong Java version installed as default one
- given Linux distribution doesn't provides compliant OpenJDK package

- when installing ODL dependencies (maven, java, ...)

- then install required version of Oracle JDK from PPA (http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html) or from RPM.
- then make installed java the current one using update alternatives

Changed in networking-odl:
assignee: nobody → Federico Ressi (federico-ressi-9)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-odl (master)

Fix proposed to branch: master
Review: https://review.openstack.org/218210

Changed in networking-odl:
status: New → In Progress
summary: - Destack plugin requires openjdk 1.7 instead of any compatible Java 7
+ Devstack plugin requires openjdk 1.7 instead of any compatible Java 7
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-odl (master)

Reviewed: https://review.openstack.org/218210
Committed: https://git.openstack.org/cgit/openstack/networking-odl/commit/?id=1f5e8511e7df71154f37b627e16f87f1a51faf6e
Submitter: Jenkins
Branch: master

commit 1f5e8511e7df71154f37b627e16f87f1a51faf6e
Author: Federico Ressi <email address hidden>
Date: Fri Aug 28 12:08:51 2015 +0100

    Detect and setup required java version in devstack.

    Change-Id: I145ee39aa8fd72d496e996e13af2338e9d240f07
    Closes-Bug: #1467949

Changed in networking-odl:
status: In Progress → Fix Committed
Revision history for this message
Federico Ressi (federico-ressi-9) wrote :

stable/liberty branch is also affected from this bug.
I am going to back port this fix to that branch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-odl (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/252673

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/253735

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on networking-odl (stable/liberty)

Change abandoned by Federico Ressi (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/252673

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-odl (stable/liberty)

Reviewed: https://review.openstack.org/253735
Committed: https://git.openstack.org/cgit/openstack/networking-odl/commit/?id=a30fe2f2d8862e2a6d20ccc7b07e93e5eb566a18
Submitter: Jenkins
Branch: stable/liberty

commit a30fe2f2d8862e2a6d20ccc7b07e93e5eb566a18
Author: Federico Ressi <email address hidden>
Date: Fri Aug 28 12:08:51 2015 +0100

    Detect and setup required java version in devstack.

    Change-Id: I145ee39aa8fd72d496e996e13af2338e9d240f07
    Closes-Bug: #1467949
    (cherry picked from commit 1f5e8511e7df71154f37b627e16f87f1a51faf6e)

tags: added: in-stable-liberty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-odl (master)

Reviewed: https://review.openstack.org/245701
Committed: https://git.openstack.org/cgit/openstack/networking-odl/commit/?id=b8f6faf758d7542801d4310a8a7da6ce7cfef8fc
Submitter: Jenkins
Branch: master

commit b8f6faf758d7542801d4310a8a7da6ce7cfef8fc
Author: gong yong sheng <gong.yongsheng@99cloud.net>
Date: Mon Nov 16 18:42:49 2015 +0800

    Use existing java env

    Different distribution and version has different java
    installation method. This patch enables using existing
    java env.

    Partial-Bug: #1467949
    Change-Id: I789c3db7235dcee287cced8a27f3f8a0a706245d

Changed in networking-odl:
status: Fix Committed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/networking-odl 2.0.0

This issue was fixed in the openstack/networking-odl 2.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.