calling fuel-client --help without local nailgun causes traceback

Bug #1348395 reported by Andrew Woodward
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Kamil Sambor

Bug Description

steps to reproduce:

workon <venv>
checkout fuel-web repo
cd fuel-web/fuelclient
pip install -r requirements.txt --upgrade
python setup.py develop
fuel --help

expected resutls:

help should be printed

if i run 'fuel node'

expected result should be 'un-able to contact server...'
and some directions on how to set the value of the server

also an issue, is that it's hard to find the option to change the server address, its not in the command line help

issues (as a list)
1) fuel --help makes calls to fuel server which is silly
2) fuel client calls to non-local server raises traceback instead of useful error message
3) how to change the server value is hidden from the user, needs to be added to help.

(fuel)andreww@aw-linux:~$ fuel --help
Traceback (most recent call last):
  File "/home/andreww/.virtualenvs/fuel/bin/fuel", line 9, in <module>
    load_entry_point('fuelclient==0.2', 'console_scripts', 'fuel')()
  File "/home/andreww/.virtualenvs/fuel/local/lib/python2.7/site-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/andreww/.virtualenvs/fuel/local/lib/python2.7/site-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/home/andreww/.virtualenvs/fuel/local/lib/python2.7/site-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/andreww/git/fuel-web/fuelclient/fuelclient/cli/parser.py", line 18, in <module>
    from fuelclient.cli.actions import actions
  File "/home/andreww/git/fuel-web/fuelclient/fuelclient/cli/actions/__init__.py", line 19, in <module>
    from fuelclient.cli.actions.deploy import DeployChangesAction
  File "/home/andreww/git/fuel-web/fuelclient/fuelclient/cli/actions/deploy.py", line 16, in <module>
    from fuelclient.cli.actions.base import Action
  File "/home/andreww/git/fuel-web/fuelclient/fuelclient/cli/actions/base.py", line 22, in <module>
    from fuelclient.client import APIClient
  File "/home/andreww/git/fuel-web/fuelclient/fuelclient/client.py", line 190, in <module>
    APIClient = Client()
  File "/home/andreww/git/fuel-web/fuelclient/fuelclient/client.py", line 60, in __init__
    self.auth_status()
  File "/home/andreww/git/fuel-web/fuelclient/fuelclient/client.py", line 83, in auth_status
    request = urllib2.urlopen(''.join([self.api_root, 'version']))
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>

Tags: cli
Kamil Sambor (ksambor)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Kamil Sambor (ksambor)
Kamil Sambor (ksambor)
Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

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

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

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

Kamil Sambor (ksambor)
Changed in fuel:
importance: Medium → High
milestone: 6.0 → 5.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/112220
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=8aa4201120df0b3fe5d2d92668c2ccc9630bfce8
Submitter: Jenkins
Branch: master

commit 8aa4201120df0b3fe5d2d92668c2ccc9630bfce8
Author: Kamil Sambor <email address hidden>
Date: Tue Jul 29 11:42:25 2014 +0200

    Modified APIClient to not call nailgun during initialization

    * changed error messages and help description
    * modified APIClient to call nailgun only during requests
    * modified the credential arguments to work correctly
    * added tests

    Change-Id: Ida542ac3c393b653331a38b06e12964dc9588abd
    Closes-Bug: #1348395

Changed in fuel:
status: In Progress → Fix Committed
Kamil Sambor (ksambor)
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.