Bug 1372461

Summary: The bodhi client does not work unless the server is installed
Product: [Fedora] Fedora Reporter: Randy Barlow <randy>
Component: bodhiAssignee: Randy Barlow <randy>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: urgent    
Version: rawhideCC: fale, lmacken, pnemade, randy, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: bodhi-2.2.0-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 17:41:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Randy Barlow 2016-09-01 19:00:31 UTC
Description of problem:
The bodhi client fails to run if bodhi-server is not installed, as it is missing the Python distribution that gets installed by the server package.


Version-Release number of selected component (if applicable):
bodhi-client-2.1.8-1.fc26.noarch


How reproducible:
Every time.


Steps to Reproduce:
0. Install bodhi-client but not bodhi-server.
1. $ bodhi


Actual results:
$ bodhi
Traceback (most recent call last):
  File "/usr/bin/bodhi", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2958, in <module>
    @_call_aside
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2944, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2971, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 635, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'bodhi==2.1.8' distribution was not found and is required by the application


Expected results:
bodhi-client should function without the server installed.

Comment 1 Zbigniew Jędrzejewski-Szmek 2016-09-01 20:20:09 UTC
> I think I will add a bodhi-common package that will own the distribution bits, which should allow bodhi-client to be installed independently of the server.

The package with the python module should be called python2-bodhi, since it's a normal shared python module. That's what the packaging guidelines specify for names, and also there won't be a conflict when python3-bodhi is added later on.

Comment 2 Randy Barlow 2016-09-02 13:25:52 UTC
Hello Zbigniew, I had actually been calling it python2-bodhi-common in my spec file while working on this, but I like your suggestion better. Thanks!

Comment 3 Fabio Alessandro Locati 2016-09-02 13:27:29 UTC
Fedora naming standard for python packages is:

source: python-%{pypi_name}
py2 bin: python2-%{pypi_name}
py3 bin: python3-%{pypi_name}

Comment 4 Randy Barlow 2016-09-02 15:41:04 UTC
I tried to fix this in the spec file, but I came to realize that bodhi/__init__.py contains server code, which makes it impossible to put that file in the python2-bodhi package without pulling in all of the server. Due to this, I've decided to fix this upstream by reorganizing the code.