Bug 1401328 - 'NoneType' object error on canceling client rpm creation
Summary: 'NoneType' object error on canceling client rpm creation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.0.0
Assignee: bizhang
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-04 20:18 UTC by Irina Gulina
Modified: 2017-03-01 22:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-01 22:14:30 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0367 0 normal SHIPPED_LIVE Red Hat Update Infrastructure 3.0 Release 2017-03-02 03:05:22 UTC

Description Irina Gulina 2016-12-04 20:18:24 UTC
Description of problem:
If a user aborts client rpm creation, it will cause an unexpected error

Version-Release number of selected component (if applicable):
iso s20161122

How reproducible:
always

Steps to Reproduce:
1. have unprotected custom repo to include in the custom client rpm
2. generate client entitlement certificate
3. generate custom client rpm and when prompted what unprotected custom repo to include into rpm press 'b', to abort. 
4. See an error and a traceback in logs

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

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 RPM:
my_client_rpm

>> Version of the configuration RPM [2.0]:

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

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

>> Port to serve Docker content on (default 5000):

Select any unprotected repositories to be included in the client configuration:
  -  1 : unprotected_repo_1
Enter value (1-1) to toggle selection, 'c' to confirm selections, or '?' for more commands: b

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


RHEL6 traceback: 

2016-12-04 14:40:02,328 - <type 'exceptions.TypeError'>
2016-12-04 14:40:02,328 - Unexpected error caught at the shell level
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 214, in create_rpm
    success = client_rpm.build_rpm(self.config, answers)
  File "/usr/lib/python2.6/site-packages/rhui/rpm/client.py", line 34, in build_rpm
    client_create_dir = os.path.join(answers['create_dir'], '%s-%s' % (answers['rpm_name'], answers['rpm_version']))
TypeError: 'NoneType' object is unsubscriptable


RHEL7 traceback: 

2016-12-04 11:20:48,046 - Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 88, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 127, in listen
    Shell.listen(self)
  File "/usr/lib/python2.7/site-packages/rhui/common/shell.py", line 186, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.7/site-packages/rhui/tools/screens/client.py", line 214, in create_rpm
    success = client_rpm.build_rpm(self.config, answers)
  File "/usr/lib/python2.7/site-packages/rhui/rpm/client.py", line 34, in build_rpm
    client_create_dir = os.path.join(answers['create_dir'], '%s-%s' % (answers['rpm_name'], answers['rpm_version']))
TypeError: 'NoneType' object has no attribute '__getitem__'

Expected results:
no error

Comment 3 Irina Gulina 2016-12-16 11:20:46 UTC
iso 20161215

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

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


Select any unprotected repositories to be included in the client configuration:
  -  1 : Unprotected Repo 1
  -  2 : Unprotected Repo 2
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: a

Select any unprotected repositories to be included in the client configuration:
  x  1 : Unprotected Repo 1
  x  2 : Unprotected Repo 2
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: b



------------------------------------------------------------------------------
rhui (client) =>

Comment 4 errata-xmlrpc 2017-03-01 22:14:30 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


Note You need to log in before you can comment on or make changes to this bug.