Fuel plugins examples don't catch not installed fpm error properly

Bug #1561069 reported by Alexander Kislitsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Medium
slava valyavskiy

Bug Description

Fpm ruby gem is not installed.
Steps to reproduce:

  git clone https://github.com/openstack/fuel-plugins.git
  mkvirtualenv fpb
  cd fuel-plugins
  pip install -r requirements.txt
  pip install -r test-requirements.txt
  python setup.py develop
  fpb --debug --build examples/fuel_plugin_example_v4/ # or any another

Expected error message:

Install 'fpm' to build this plugin. Aborting.

Actual:
2016-03-23 18:51:58 DEBUG 20341 (build) Start plugin building "examples/fuel_plugin_example_v4/"
2016-03-23 18:51:58 DEBUG 20341 (utils) Removing "examples/fuel_plugin_example_v4/.build"
2016-03-23 18:51:58 DEBUG 20341 (utils) Creating directory examples/fuel_plugin_example_v4/.build
2016-03-23 18:51:58 DEBUG 20341 (utils) Remove files by mask examples/fuel_plugin_example_v4/fuel_plugin_example_v4-*.noarch.rpm
2016-03-23 18:51:58 DEBUG 20341 (utils) Execute command "examples/fuel_plugin_example_v4/pre_build_hook"
2016-03-23 18:51:58 DEBUG 20341 (utils) Stdout and stderr of command "examples/fuel_plugin_example_v4/pre_build_hook":
2016-03-23 18:51:58 DEBUG 20341 (utils) + command -v fpm
2016-03-23 18:51:58 DEBUG 20341 (utils) +++ readlink -f examples/fuel_plugin_example_v4/pre_build_hook
2016-03-23 18:51:58 DEBUG 20341 (utils) ++ dirname /home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4/pre_build_hook
2016-03-23 18:51:58 DEBUG 20341 (utils) + ROOT=/home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4
2016-03-23 18:51:58 DEBUG 20341 (utils) + UBUNTU_REPO_PATH=/home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4/repositories/ubuntu
2016-03-23 18:51:58 DEBUG 20341 (utils) + CENTOS_REPO_PATH=/home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4/repositories/centos
2016-03-23 18:51:58 DEBUG 20341 (utils) + rm -f '/home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4/repositories/ubuntu/*.deb'
2016-03-23 18:51:58 DEBUG 20341 (utils) + rm -f '/home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4/repositories/centos/*.rpm'
2016-03-23 18:51:58 DEBUG 20341 (utils) + fpm -t deb -p /home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4/repositories/ubuntu -n fuel-simple-service -v 4.0.0 -s dir /home/sand/PycharmProjects/fuel-plugins/examples/fuel_plugin_example_v4/fuel-simple-service.py=/usr/bin/fuel-simple-service.py
2016-03-23 18:51:58 DEBUG 20341 (utils) /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find fpm (>= 0) amongst [CFPropertyList-2.2.8, Platform-0.4.0, activesupport-3.0.10, amq-protocol-2.0.0, amqp-1.4.1, bundler-1.7.6, bundler-unload-1.0.2, concurrent-ruby-0.9.1, diff-lcs-1.2.5, eventmachine-1.0.8, executable-hooks-1.3.2, facter-2.4.4, gem-wrappers-1.2.7, i18n-0.7.0, json-1.8.3, mcollective-client-2.4.1, metaclass-0.0.4, mime-types-1.25.1, mocha-0.13.3, multi_json-1.11.2, net-ssh-2.9.2, net-ssh-gateway-1.2.0, net-ssh-multi-1.2.1, open4-1.3.4, popen4-0.1.2, raemon-0.3.0, rake-10.0.4, rest-client-1.6.9, rspec-2.13.0, rspec-core-2.13.1, rspec-expectations-2.13.0, rspec-mocks-2.13.1, rubygems-bundler-1.4.4, rvm-1.11.3.9, simplecov-0.7.1, simplecov-html-0.7.1, simplecov-rcov-0.2.3, stomp-1.3.4, symboltable-1.0.2, systemu-2.6.5] (Gem::LoadError)
2016-03-23 18:51:58 DEBUG 20341 (utils) from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
2016-03-23 18:51:58 DEBUG 20341 (utils) from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
2016-03-23 18:51:58 DEBUG 20341 (utils) from /usr/local/bin/fpm:22:in `<main>'
2016-03-23 18:51:58 ERROR 20341 (cli) Shell command executed with "1" exit code: examples/fuel_plugin_example_v4/pre_build_hook
Traceback (most recent call last):
  File "/home/sand/PycharmProjects/fuel-plugins/fuel_plugin_builder/cli.py", line 126, in main
    perform_action(args)
  File "/home/sand/PycharmProjects/fuel-plugins/fuel_plugin_builder/cli.py", line 106, in perform_action
    actions.make_builder(args.build).run()
  File "/home/sand/PycharmProjects/fuel-plugins/fuel_plugin_builder/actions/build.py", line 69, in run
    self.run_pre_build_hook()
  File "/home/sand/PycharmProjects/fuel-plugins/fuel_plugin_builder/actions/build.py", line 82, in run_pre_build_hook
    utils.exec_cmd(self.pre_build_hook_path)
  File "/home/sand/PycharmProjects/fuel-plugins/fuel_plugin_builder/utils.py", line 95, in exec_cmd
    'exit code: {1} '.format(exit_code, cmd))
ExecutedErrorNonZeroExitCode: Shell command executed with "1" exit code: examples/fuel_plugin_example_v4/pre_build_hook
Unexpected error
Shell command executed with "1" exit code: examples/fuel_plugin_example_v4/pre_build_hook

Tags: area-plugins
description: updated
Dmitry Klenov (dklenov)
Changed in fuel:
status: New → Confirmed
Revision history for this message
slava valyavskiy (slava-val-al) wrote :

I was not able to reproduce a bug on Ubuntu and Centos environments. All plugins examples have been built successfully. I suppose that you have issue with your environment, especially with 'fpm' gem. Could you re-install it please?(or check somehow that it's really operational)

Changed in fuel:
status: Confirmed → Invalid
status: Invalid → Incomplete
summary: - Fuel plugins builder can't build example plugin
+ Fuel plugins examples don't report about non installed fpm
description: updated
Revision history for this message
Alexander Kislitsky (akislitsky) wrote : Re: Fuel plugins examples don't report about non installed fpm

@Slava, thanks for response.

You are right - fpm wasn't installed, but error checking code in plugins pre_build_hook doesn't work in this case: [0].
I've changed bug description and priority to medium.

[0] https://github.com/openstack/fuel-plugins/blob/master/examples/fuel_plugin_example_v4/pre_build_hook#L4-L6

Changed in fuel:
importance: High → Medium
status: Incomplete → Confirmed
status: Confirmed → New
summary: - Fuel plugins examples don't report about non installed fpm
+ Fuel plugins examples don't catch not installed fpm error properly
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → slava valyavskiy (slava-val-al)
status: New → Confirmed
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/297264

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

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

commit ba733b62a0033d742e20753b32b810d6269d2863
Author: slava <email address hidden>
Date: Thu Mar 24 20:15:07 2016 +0300

    Use more reliable way to check 'fpm' gem presence

    Change-Id: I9074472ba40747be5b7bf055d503564eaada4279
    Closes-bug: #1561069

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Nastya Urlapova (aurlapova) wrote :
Changed in fuel:
status: Fix Committed → Fix Released
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.