Bug 1405083

Summary: The atomic client configuration package dialog fails on RHEL 6
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Radek Bíba <rbiba>
Component: ToolsAssignee: RHUI Bug List <rhui-bugs>
Status: CLOSED ERRATA QA Contact: Radek Bíba <rbiba>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0.0CC: bizhang, lwilliam, pcreech
Target Milestone: ---   
Target Release: 3.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1404659 Environment:
Last Closed: 2017-03-01 22:15:00 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: 1404659    
Bug Blocks: 1356695    

Description Radek Bíba 2016-12-15 14:45:59 UTC
+++ This bug was initially created as a clone of Bug #1404659 +++

Description of problem:
The new action in rhui-manager from 20161213, 'o   create an atomic client configuration package', isn't working on RHEL 6. rhui-manager generates an empty tarball, prints "an unexpected error occurs", and saves a traceback in the RHUI log.

Version-Release number of selected component (if applicable):
RHUI 3 ISO 2016121{3,4} for RHEL 6

How reproducible:
Always

Steps to Reproduce:
1. Run rhui-manager.
2. You must have a repo and a cert for it. Add a repo and create a cert for it otherwise.
3. Select 'e    create entitlement certificates and client configuration RPMs'
4. Select 'o    create an atomic client configuration package'
5. Fill out the form, so to speak.

Actual results:
====
rhui (client) => o

Full path to local directory in which the client configuration files generated by this tool
should be stored (if this directory does not exist, it will be created):
/tmp

Name of the tar file (excluding extension):
testcerttar

Full path to the entitlement certificate authorizing the client to access
specific channels:
/tmp/testcert.crt

Full path to the private key for the above entitlement certificate:
/tmp/testcert.key

Port to serve Docker content on (default 5000):



An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.
====

"More information" is here:

====
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 88, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 127, in listen
    Shell.listen(self)
  File "/usr/lib/python2.6/site-packages/rhui/common/shell.py", line 186, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/client.py", line 256, in create_atomic_package
    client_atomic.create_tarball(self.config, answers)
  File "/usr/lib/python2.6/site-packages/rhui/atomic/client.py", line 38, in create_tarball
    with tarfile.open(name=tarball_name, mode='w:gz') as tarball:
AttributeError: 'TarFile' object has no attribute '__exit__'
====

Comment 2 Patrick Creech 2016-12-15 20:30:26 UTC
While ostree content is not supported on RHEL6, this does need to be handled better.

Suggestions are:
1.  Hide this menu option on rhel6 (preferred)

2.  Return a message upon entering this menu option that it is not supported.

Comment 5 Radek Bíba 2017-01-18 09:31:02 UTC
Unfortunately, the fix didn't work. I still see 'o   create an atomic client configuration package' on RHEL 6.

I believe the problem is in the way the distribution is determined. The code reads:

if platform.linux_distribution()[2] is not 'Santiago':
    self.add_menu_item(MenuItem('o', 'create an atomic client configuration package', self.create_atomic_package))

But 'is not' compares objects, not strings, doesn't it? So the condition is always met. You need != instead.

Comment 6 Radek Bíba 2017-01-19 09:17:53 UTC
Confirmed in 20170118 - 'o   create an atomic client configuration package' is no longer available on RHEL 6. Thanks.

Comment 7 errata-xmlrpc 2017-03-01 22:15:00 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-2017:0367