Bug 1678874

Summary: [packaging] ocf.py is not shipped with respective *.pyc files (guidelines violation, and practically, e.g., preventing [performance] hitless read-only /usr)
Product: Red Hat Enterprise Linux 8 Reporter: Jan Pokorný [poki] <jpokorny>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: agk, cluster-maint, fdinitto, mjuricek, mnovacek
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: resource-agents-4.1.1-19.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 20:34:25 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:
Bug Depends On: 1682136    
Bug Blocks:    

Description Jan Pokorný [poki] 2019-02-19 19:02:15 UTC
Observe:

# dnf install resource-agents-gcp pcs

# find /usr/lib/ocf/lib/heartbeat -name '*.py*'
> /usr/lib/ocf/lib/heartbeat/ocf.py

# pcs resource describe ocf:heartbeat:gcp-vpc-move-vip | head -n1
> ocf:heartbeat:gcp-vpc-move-vip - Floating IP Address on Google Cloud Platform

# find /usr/lib/ocf/lib/heartbeat -name '*.py*'
> /usr/lib/ocf/lib/heartbeat/__pycache__/ocf.cpython-36.pyc
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> /usr/lib/ocf/lib/heartbeat/ocf.py

# rpm -qf /usr/lib/ocf/lib/heartbeat/__pycache__/ocf.cpython-36.pyc
> file /usr/lib/ocf/lib/heartbeat/__pycache__/ocf.cpython-36.pyc is not owned by any package

--> packaging problem/violation:
    https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_byte_compiling
    "You must include the .pyc files in your package."

--> https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#manual-bytecompilation
    resource-agents.spec:

> [...]
> BuildRequires: python3-devel
> [...]
> %install
> [...]
> %py_byte_compile %{__python3} %{buildroot}/usr/lib/ocf/lib/heartbeat

--> check resource-agents.rpm contains 2 new files matching the glob:
    /usr/lib/ocf/lib/heartbeat/__pycache__/ocf.cpython-*

Comment 6 errata-xmlrpc 2019-11-05 20:34:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3307