Invalid working directory for shell tasks in plugins

Bug #1603987 reported by Georgy Kibardin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Georgy Kibardin

Bug Description

Non existing directory /etc/fuel/plugins/<plugin name> is used as a current directory for shell tasks causing them fail.

Steps to reproduce:
1. Create a plugin with the following task:
- id: plugin_version_test
  type: shell
  version: 2.0.0
  role: master
  requires: [deploy_start]
  required_for: [deploy_end]
  parameters:
    cmd: echo {PLUGIN_VERSION}
    retries: 1
    interval: 10
    timeout: 120
2. Create an env, enable the plugin and start deployment

Expected result:
 - deployment succeeded
Actual result:
 - deployment failed

Check the content of /etc/puppet/shell_manifests/<plugin name>_command.sh. It contains "cd /etc/fuel/plugins/<plugin name>" statement which causes deployment failure.

Changed in fuel:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Georgy Kibardin (gkibardin)
milestone: none → 10.0
tags: added: area-plugins area-python
Revision history for this message
Georgy Kibardin (gkibardin) wrote :

Making it medium since it only affects shell tasks on master node.

Changed in fuel:
importance: High → Medium
Changed in fuel:
status: Confirmed → Incomplete
status: Incomplete → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-plugins (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-plugins (master)

Reviewed: https://review.openstack.org/344828
Committed: https://git.openstack.org/cgit/openstack/fuel-plugins/commit/?id=3f33bf09e3df3a66a01d6a7bb4d324a62975c700
Submitter: Jenkins
Branch: master

commit 3f33bf09e3df3a66a01d6a7bb4d324a62975c700
Author: Georgy Kibardin <email address hidden>
Date: Wed Jul 20 16:10:18 2016 +0300

    Make a symlink to deployment scripts in /etc

    On master node there is no /etc/fuel/plugins/<plugin name>
    directory. This causes failures of a plugin shell tasks on master node
    because before execution there is an attempt to set current directory to
    it. In order to fix this we make a symlink:

    /etc/fuel/plugins/<plugin name> ->
    /var/www/nailgun/plugins/<plugin name>/deployment_scripts

    Change-Id: Idbd2d94462b72a7f98967b379f504c245a6c7135
    Closes-Bug: #1603987

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-plugins (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/409322

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-library (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/409377

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-library (master)

Reviewed: https://review.openstack.org/409377
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=0bb6ffbcb5ee6734fcf5dfd5f4dca20a5caa3b88
Submitter: Jenkins
Branch: master

commit 0bb6ffbcb5ee6734fcf5dfd5f4dca20a5caa3b88
Author: Evgeny L <email address hidden>
Date: Sat Dec 10 00:04:53 2016 +0000

    Create symlink which is required for master node plugin tasks

    Place where plugins are linked depends on configuration (of Nailgun,
    MCollective, Astute), hence must not be hardcoded in specs and
    should be done by puppet manifests which own master node configuration
    details.

    Change-Id: I1e9db92f9fc8dc70403113d1d6f9062b689dd2ee
    Related-bug: #1603987
    Closes-bug: #1648882

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-library (stable/newton)

Related fix proposed to branch: stable/newton
Review: https://review.openstack.org/411903

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-library (stable/mitaka)

Related fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/411904

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-library (stable/mitaka)

Reviewed: https://review.openstack.org/411904
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=c48b67f10d44beb07595fa90ea7fad3ad9da2209
Submitter: Jenkins
Branch: stable/mitaka

commit c48b67f10d44beb07595fa90ea7fad3ad9da2209
Author: Evgeny L <email address hidden>
Date: Sat Dec 10 00:04:53 2016 +0000

    Create symlink which is required for master node plugin tasks

    Place where plugins are linked depends on configuration (of Nailgun,
    MCollective, Astute), hence must not be hardcoded in specs and
    should be done by puppet manifests which own master node configuration
    details.

    Change-Id: I1e9db92f9fc8dc70403113d1d6f9062b689dd2ee
    Related-bug: #1603987
    Closes-bug: #1648882
    (cherry picked from commit 0bb6ffbcb5ee6734fcf5dfd5f4dca20a5caa3b88)

tags: added: in-stable-mitaka
tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-library (stable/newton)

Reviewed: https://review.openstack.org/411903
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=7811459e976aa8df06754316249d9509f7b79bc6
Submitter: Jenkins
Branch: stable/newton

commit 7811459e976aa8df06754316249d9509f7b79bc6
Author: Evgeny L <email address hidden>
Date: Sat Dec 10 00:04:53 2016 +0000

    Create symlink which is required for master node plugin tasks

    Place where plugins are linked depends on configuration (of Nailgun,
    MCollective, Astute), hence must not be hardcoded in specs and
    should be done by puppet manifests which own master node configuration
    details.

    Change-Id: I1e9db92f9fc8dc70403113d1d6f9062b689dd2ee
    Related-bug: #1603987
    Closes-bug: #1648882
    (cherry picked from commit 0bb6ffbcb5ee6734fcf5dfd5f4dca20a5caa3b88)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-plugins (master)

Reviewed: https://review.openstack.org/409322
Committed: https://git.openstack.org/cgit/openstack/fuel-plugins/commit/?id=13c73e560959f2de7acc7227a616fb90edd54d05
Submitter: Jenkins
Branch: master

commit 13c73e560959f2de7acc7227a616fb90edd54d05
Author: Evgeny L <email address hidden>
Date: Fri Dec 9 20:19:41 2016 +0000

    Revert "Make a symlink to deployment scripts in /etc"

    The fix broke backward compatibility and used hardcoded
    value.

    Related-bug: #1603987
    Related-bug: #1648882
    This reverts commit 3f33bf09e3df3a66a01d6a7bb4d324a62975c700.

    Change-Id: Ie3420116926bef518d68c3e3b381e5cff4c98b6f

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.