[fuel-master][centos7] Argparse EntryPoint.parse error

Bug #1525236 reported by Aleksey Zvyagintsev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Dmitry Teselkin

Bug Description

Looks like something wrong with python compatability on centos7
Upgrading argparse to latest with pip - fixes problem.

###Issue

[root@nailgun ~]# fuel2 --help
usage: fuel2 [--version] [-v] [--log-file LOG_FILE] [-q] [-h] [--debug]
             [--fuel-version]

Command line interface and Python API wrapper for Fuel.

optional arguments:
  --version show program's version number and exit
  -v, --verbose Increase verbosity of output. Can be repeated.
  --log-file LOG_FILE Specify a file to log output. Disabled by default.
  -q, --quiet suppress output except warnings and errors
  -h, --help show this help message and exit
  --debug show tracebacks on errors
  --fuel-version show Fuel server's version number and exit. WARNING:
                       deprecated since 7.0 release. Please use fuel-version
                       command instead

Commands:
  complete print bash completion command
Could not load EntryPoint.parse('env_add_nodes = fuelclient.commands.environment:EnvAddNodes')
Could not load EntryPoint.parse('env_create = fuelclient.commands.environment:EnvCreate')
Could not load EntryPoint.parse('env_delete = fuelclient.commands.environment:EnvDelete')
Could not load EntryPoint.parse('env_deploy = fuelclient.commands.environment:EnvDeploy')
Could not load EntryPoint.parse('env_list = fuelclient.commands.environment:EnvList')
Could not load EntryPoint.parse('env_show = fuelclient.commands.environment:EnvShow')
Could not load EntryPoint.parse('env_spawn-vms = fuelclient.commands.environment:EnvSpawnVms')
Could not load EntryPoint.parse('env_update = fuelclient.commands.environment:EnvUpdate')
Could not load EntryPoint.parse('env_upgrade = fuelclient.commands.environment:EnvUpgrade')
Could not load EntryPoint.parse('fuel-version = fuelclient.commands.fuelversion:FuelVersion')
  help print detailed help for another command
Could not load EntryPoint.parse('network-group_create = fuelclient.commands.network_group:NetworkGroupCreate')
Could not load EntryPoint.parse('network-group_delete = fuelclient.commands.network_group:NetworkGroupDelete')
Could not load EntryPoint.parse('network-group_list = fuelclient.commands.network_group:NetworkGroupList')
Could not load EntryPoint.parse('network-group_show = fuelclient.commands.network_group:NetworkGroupShow')
Could not load EntryPoint.parse('network-group_update = fuelclient.commands.network_group:NetworkGroupUpdate')
Could not load EntryPoint.parse('network-template_delete = fuelclient.commands.network_template:NetworkTemplateDelete')
Could not load EntryPoint.parse('network-template_download = fuelclient.commands.network_template:NetworkTemplateDownload')
Could not load EntryPoint.parse('network-template_upload = fuelclient.commands.network_template:NetworkTemplateUpload')
Could not load EntryPoint.parse('node_create-vms-conf = fuelclient.commands.node:NodeCreateVMsConf')
Could not load EntryPoint.parse('node_label_delete = fuelclient.commands.node:NodeLabelDelete')
Could not load EntryPoint.parse('node_label_list = fuelclient.commands.node:NodeLabelList')
Could not load EntryPoint.parse('node_label_set = fuelclient.commands.node:NodeLabelSet')
Could not load EntryPoint.parse('node_list = fuelclient.commands.node:NodeList')
Could not load EntryPoint.parse('node_list-vms-conf = fuelclient.commands.node:NodeVmsList')
Could not load EntryPoint.parse('node_show = fuelclient.commands.node:NodeShow')
Could not load EntryPoint.parse('node_update = fuelclient.commands.node:NodeUpdate')
Could not load EntryPoint.parse('openstack-config_download = fuelclient.commands.openstack_config:OpenstackConfigDownload')
Could not load EntryPoint.parse('openstack-config_execute = fuelclient.commands.openstack_config:OpenstackConfigExecute')
Could not load EntryPoint.parse('openstack-config_list = fuelclient.commands.openstack_config:OpenstackConfigList')
Could not load EntryPoint.parse('openstack-config_upload = fuelclient.commands.openstack_config:OpenstackConfigUpload')
Could not load EntryPoint.parse('plugins_sync = fuelclient.commands.plugins:PluginsSync')
Could not load EntryPoint.parse('task_list = fuelclient.commands.task:TaskList')
Could not load EntryPoint.parse('task_show = fuelclient.commands.task:TaskShow')

### Version
cat /etc/fuel/version.yaml
VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "8.0"
  api: "1.0"
  build_number: "286"
  build_id: "286"
  fuel-nailgun_sha: "eb187d0eed96226ca0d8c4513ffcafc4d09dee62"
  python-fuelclient_sha: "f96659066e522e28b389de3cc685f6f2aacca3da"
  fuel-agent_sha: "2f18b7596bc7da79d2f28c34f42620b2090d8a35"
  fuel-nailgun-agent_sha: "a33a58d378c117c0f509b0e7badc6f0910364154"
  astute_sha: "e8c753d6ce1405df78d032e88c0d5a1c6f3d17ce"
  fuel-library_sha: "15d966e164a8b8f7d94c70863bd1cc4990703ec8"
  fuel-ostf_sha: "632730169e8c01afe7fd5d78a898f00d4646358b"
  fuel-mirror_sha: "31b9df814960ec69b644ca9b689dacec0c7e10a1"
  fuelmenu_sha: "680b720291ff577f4c058cee25f85e563c96312e"
  shotgun_sha: "a0bd06508067935f2ae9be2523ed0d1717b995ce"
  network-checker_sha: "a3534f8885246afb15609c54f91d3b23d599a5b1"
  fuel-upgrade_sha: "1e894e26d4e1423a9b0d66abd6a79505f4175ff6"
  fuelmain_sha: "1577a306c2c9e7bd12f28c0e16cf3652997da004"

Revision history for this message
Dmitry Teselkin (teselkin-d) wrote :

Looks like issue with 'cliff'.

vi /usr/lib/python2.7/site-packages/cliff/help.py
---
21 try:
22 factory = ep.load()
23 except Exception as err:
24 app.stdout.write('Could not load %r\n' % ep)
25 if namespace.debug:
26 traceback.print_exc(file=app.stdout)
27 continue
---

It could be fixed by the code below (see line 25)
---
21 try:
22 factory = ep.load()
23 except Exception as err:
24 app.stdout.write('Could not load %r\n' % ep)
25 if getattr(namespace, 'debug', False):
26 traceback.print_exc(file=app.stdout)
27 continue
---

Revision history for this message
Aleksander Mogylchenko (amogylchenko) wrote :

It seems more like a compatibility problem. Installing argparse with pip is a bad idea.

Changed in fuel:
assignee: MOS Linux (mos-linux) → Fuel Python Team (fuel-python)
Revision history for this message
Arthur Svechnikov (asvechnikov) wrote :

additional info

[root@nailgun ~]# fuel2 --debug -v --help
usage: fuel2 [--version] [-v] [--log-file LOG_FILE] [-q] [-h] [--debug]
             [--fuel-version]

Command line interface and Python API wrapper for Fuel.

optional arguments:
  --version show program's version number and exit
  -v, --verbose Increase verbosity of output. Can be repeated.
  --log-file LOG_FILE Specify a file to log output. Disabled by default.
  -q, --quiet suppress output except warnings and errors
  -h, --help show this help message and exit
  --debug show tracebacks on errors
  --fuel-version show Fuel server's version number and exit. WARNING:
                       deprecated since 7.0 release. Please use fuel-version
                       command instead

Commands:
  complete print bash completion command
Could not load EntryPoint.parse('env_add_nodes = fuelclient.commands.environment:EnvAddNodes')
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/help.py", line 22, in __call__
    factory = ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2354, in load
    self.require(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2371, in require
    items = working_set.resolve(reqs, env, installer)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 839, in resolve
    raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'argparse' distribution was not found and is required by cliff

[root@nailgun ~]# python
Python 2.7.5 (default, Jun 24 2015, 00:41:19)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
>>> argparse.__file__
'/usr/lib64/python2.7/argparse.pyc'
>>>

Revision history for this message
Arthur Svechnikov (asvechnikov) wrote :

@Dmitry this is not a solution, debug property always should be. The problem is that pkg_resources don't see argparse.

Dmitry Pyzhov (dpyzhov)
tags: added: feature-centos7 team-centos
removed: python
Dmitry Pyzhov (dpyzhov)
tags: added: team-linux
removed: team-centos
Revision history for this message
Dmitry Teselkin (teselkin-d) wrote :

Don't think we need 'argparse' in requirements [1] since it's included in python 2.7

[1] https://github.com/openstack/python-fuelclient/blob/master/requirements.txt#L4

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-fuelclient (master)

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

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Dmitry Teselkin (teselkin-d)
status: Confirmed → In Progress
Revision history for this message
Dmitry Teselkin (teselkin-d) wrote :

Remove argparse from pytho-cliff https://review.fuel-infra.org/#/c/14648/

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

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

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix proposed to packages/centos7/python-cliff (8.0)

Related fix proposed to branch: 8.0
Change author: Dmitry Teselkin <email address hidden>
Review: https://review.fuel-infra.org/14656

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

Reviewed: https://review.openstack.org/256592
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=6156dbfa121da3b9aceeaf0e01dd4d5ccf589718
Submitter: Jenkins
Branch: master

commit 6156dbfa121da3b9aceeaf0e01dd4d5ccf589718
Author: Dmitry Teselkin <email address hidden>
Date: Fri Dec 11 20:08:15 2015 +0300

    Remove argparse from requirements

    argparse is included in Python 2.7, so we don't need
    it as an explicit requirement.

    Change-Id: I5d4234392414d617af737074d16c68363185922e
    Related-Bug: #1524714
    Closes-Bug: #1525236

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

Reviewed: https://review.openstack.org/257349
Committed: https://git.openstack.org/cgit/openstack/fuel-agent/commit/?id=236df3e057e18c3667b7bf8ca2ac3204a657a0c4
Submitter: Jenkins
Branch: master

commit 236df3e057e18c3667b7bf8ca2ac3204a657a0c4
Author: Dmitry Teselkin <email address hidden>
Date: Mon Dec 14 16:29:31 2015 +0300

    Remove argparse from requirements

    argparse is not required explicitely if running in python 2.7,
    which is default in CentOS7.

    Change-Id: I8e12c2473d9e667798aebb89e07137f594248876
    Related-Bug: #1525236

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix merged to packages/centos7/python-cliff (8.0)

Reviewed: https://review.fuel-infra.org/14656
Submitter: Pkgs Jenkins <email address hidden>
Branch: 8.0

Commit: ced0ecdc7327ad3b9f190aaaf146dabf944f9904
Author: Dmitry Teselkin <email address hidden>
Date: Mon Dec 14 14:36:32 2015

Remove argpargse from requirements

Keeping 'argparse' in requirements.txt might fail
component on python2.7 environment if pkg_requirement
fails to detect that argparse is available in the system
as part of python 2.7.

For CentOS6 it's not a problem as there will is
python-argparse requirement for that platform.

Related-Bug: #1525236

Change-Id: I0c10e2370b49bdba121522bdb672d0a1d8c8e0da

Revision history for this message
Tatyanka (tatyana-leontovich) wrote :

verified 509 iso

Changed in fuel:
status: Fix Committed → Fix Released
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on packages/centos7/python-cliff (master)

Change abandoned by Dmitry Teselkin <email address hidden> on branch: master
Review: https://review.fuel-infra.org/14648

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.