Bug 599086 - improve configfile handling
Summary: improve configfile handling
Alias: None
Product: Beaker
Classification: Community
Component: command line   
(Show other bugs)
Version: 0.5
Hardware: All
OS: Linux
medium vote
Target Milestone: ---
Assignee: Bill Peck
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2010-06-02 16:25 UTC by Karel Volný
Modified: 2010-06-09 21:06 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-06-09 21:06:49 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Karel Volný 2010-06-02 16:25:36 UTC
Description of problem:
running 'make bkradd' failed for me

after creating a configfile ~/.beaker_client/config:

HUB_URL = "https://beaker.engineering.redhat.com"
AUTH_METHOD = "krbv"

it reports success

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

How reproducible:

Steps to Reproduce:
1. on a clean system, install beaker-client
2. go into some test directory
3. make bkradd
Actual results:
+ exit 0
/tmp/rhts-build-PN7MRWNN/install ~/RHTS/cvs/postgresql/postgresql-tests/Security/CVE-2010-0442-substring-negative-length-argument-buffer-overflow
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Traceback (most recent call last):
  File "/usr/bin/bkr", line 9, in <module>
    load_entry_point('bkr.client==0.5.32', 'console_scripts', 'bkr')()
  File "/usr/lib/python2.6/site-packages/bkr/client/main.py", line 32, in main
    return parser.run()
  File "/usr/lib/python2.6/site-packages/kobo/cli.py", line 203, in run
    cmd.run(*cmd_args, **cmd_kwargs)
  File "/usr/lib/python2.6/site-packages/bkr/client/commands/cmd_task_add.py", line 25, in run
    self.set_hub(username, password)
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 58, in set_hub
    self.hub = HubProxyClass(conf=conf)
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 124, in __init__
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 163, in _login
    if force or self._hub.auth.renew_session():
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
  File "/usr/lib/python2.6/site-packages/kobo/xmlrpc.py", line 155, in request
    result = transport_class.request(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/kobo/xmlrpc.py", line 99, in request
    self.send_content(h, request_body)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1349, in send_content
  File "/usr/lib64/python2.6/httplib.py", line 892, in endheaders
  File "/usr/lib64/python2.6/httplib.py", line 764, in _send_output
  File "/usr/lib64/python2.6/httplib.py", line 723, in send
  File "/usr/lib64/python2.6/httplib.py", line 704, in connect
  File "/usr/lib64/python2.6/socket.py", line 514, in create_connection
    raise error, msg
socket.error: [Errno 111] Connection refused
Finished building test package

Expected results:
+ exit 0
/tmp/rhts-build-S8vCA6MB/install ~/RHTS/cvs/postgresql/postgresql-tests/Security/CVE-2010-0442-substring-negative-length-argument-buffer-overflow
Finished building test package

Additional info:
if ~/.beaker_client/config does not exist, it should be created automatically and pre-filed with sane defaults

if that is not possible for some reason, some error message about missing configfile or wrong settings should be printed

saying "Connection failed, retrying. Error was: [Errno 111] Connection refused" and ending in cryptic traceback is not acceptable - connection to WHAT has failed? WHICH server has refused connection?

Comment 1 Bill Peck 2010-06-02 18:10:40 UTC
Thanks for the report.

the error message will be fixed in kobo. Ed Santiago already provided Daniel Mach a patch for that.  So as soon as kobo is updated we will get it.

I did update the code to print a warning if no user config is present.

diff --git a/Client/src/bkr/client/__init__.py b/Client/src/bkr/client/__init__.py
index c60a76c..863ba0f 100644
--- a/Client/src/bkr/client/__init__.py
+++ b/Client/src/bkr/client/__init__.py
@@ -22,6 +22,7 @@ class BeakerCommand(ClientCommand):
             conf = old_conf
             conf = "/etc/beaker/client.conf"
+            sys.stderr.write("%s not found, using %s\n" % (user_conf, conf))
         os.environ[conf_environ_key] = conf
 class BeakerWorkflow(BeakerCommand):

This will be in the next release.

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