Bug 1098529

Summary: [RFE] enhance configuration handling for pulp-consumer
Product: [Retired] Pulp Reporter: mkovacik
Component: consumersAssignee: pulp-bugs
Status: CLOSED UPSTREAM QA Contact: pulp-qe-list
Severity: unspecified Docs Contact:
Priority: medium    
Version: 2.4 BetaCC: mhrivnak, skarmark
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-19 01:13:20 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:
Attachments:
Description Flags
consumer config file none

Description mkovacik 2014-05-16 13:06:29 UTC
Created attachment 896385 [details]
consumer config file

Description of problem:
run into stack dump while using new consumer and old consumer config file

Version-Release number of selected component (if applicable):
pulp-consumer-client-2.4.0-0.14.beta.fc20.noarch


How reproducible:
Always

Steps to Reproduce:
1. either remove [Authentication] section from /etc/pulp/consumer/consumer.conf or use old configuration file (attached)
2. pulp-consumer -u <username> -p <password> register --consumer-id <id>

Actual results:
[root@dhcp131-38 ~]# pulp-consumer -u admin -p admin register --consumer-id milan
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/consumer.log.

[root@dhcp131-38 ~]# tail -15 .pulp/consumer.log 
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/consumer/cli.py", line 172, in register
    path = self.context.config['authentication']['rsa_key']
KeyError: 'authentication'
2014-05-16 08:57:32,587 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/consumer/cli.py", line 172, in register
    path = self.context.config['authentication']['rsa_key']
KeyError: 'authentication'


Expected results:
Configuration Incompatibility message shown instead of unexpected error

Additional info:

Comment 1 Michael Hrivnak 2014-05-16 16:24:05 UTC
We should also add default values for all consumer config values, similar to what the pulp server does.

Comment 2 Brian Bouterse 2015-02-19 01:13:20 UTC
Moved to https://pulp.plan.io/issues/231