Bug 1165852 - entitlement-check.py: AttributeError: DEFAULT_DB
Summary: entitlement-check.py: AttributeError: DEFAULT_DB
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades
Version: 570
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks: sat570-upgrades
TreeView+ depends on / blocked
 
Reported: 2014-11-19 21:01 UTC by Jan Hutař
Modified: 2015-01-20 11:18 UTC (History)
5 users (show)

Fixed In Version: rhn-upgrade-5.7.0.6-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-20 11:18:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1285973 0 None None None Never

Description Jan Hutař 2014-11-19 21:01:17 UTC
Description of problem:
entitlement-check.py produces traceback:

AttributeError: DEFAULT_DB


Version-Release number of selected component (if applicable):
Upgraded Satellite 5.6.0 on RHEL5
rhn-upgrade-5.7.0.5-1.el5sat
python-psycopg2-2.0.14-3.el5sat


How reproducible:
always


Steps to Reproduce:
1. # cd /etc/sysconfig/rhn/satellite-upgrade/scripts
2. # ./entitlement-check.py --rhn-cert=/root/satellite-engineering-qa-5.6.cert


Actual results:
# ./entitlement-check.py --rhn-cert=/root/satellite-engineering-qa-5.6.cert
Traceback (most recent call last):
  File "./entitlement-check.py", line 328, in ?
    main()
  File "./entitlement-check.py", line 71, in main
    db = options.db or CFG.DEFAULT_DB
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 222, in __getattr__
    raise AttributeError(key)
AttributeError: DEFAULT_DB


Expected results:
Should work


Additional info:
To me knowleadge DB is configured correctly:

# grep db_ /etc/rhn/rhn.conf 
db_backend = postgresql
db_user = rhnuser
db_password = rhnpw
db_name = rhnschema
db_host = 
db_port = 
# echo "SELECT * FROM dual;" | spacewalk-sql --select-mode-direct -
 dummy 
-------
 X
(1 row)

Comment 2 Stephen Herr 2014-11-21 15:53:59 UTC
Copying from bug 1165766:

Same problem for recognize_guests.py script:


# /etc/sysconfig/rhn/satellite-upgrade/scripts/recognize_guests.py
Traceback (most recent call last):
  File "/etc/sysconfig/rhn/satellite-upgrade/scripts/recognize_guests.py", line 229, in ?
    main()
  File "/etc/sysconfig/rhn/satellite-upgrade/scripts/recognize_guests.py", line 102, in main
    db = options.db or CFG.DEFAULT_DB
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 222, in __getattr__
    raise AttributeError(key)
AttributeError: DEFAULT_DB


When you add:


    print 'options.db = ', options.db
    print 'CFG.DEFAULT_DB = ', CFG.DEFAULT_DB


you get:


# /etc/sysconfig/rhn/satellite-upgrade/scripts/recognize_guests.py
options.db =  None
CFG.DEFAULT_DB = 
Traceback (most recent call last):
  File "/etc/sysconfig/rhn/satellite-upgrade/scripts/recognize_guests.py", line 231, in ?
    main()
  File "/etc/sysconfig/rhn/satellite-upgrade/scripts/recognize_guests.py", line 103, in main
    print 'CFG.DEFAULT_DB = ', CFG.DEFAULT_DB
  File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnConfig.py", line 222, in __getattr__
    raise AttributeError(key)
AttributeError: DEFAULT_DB

Comment 10 Lukáš Hellebrandt 2015-01-19 15:37:23 UTC
Re-verified
rhn-upgrade-5.7.0.22-1

./entitlement-check.py --rhn-cert=<file>.cert 
WARNING: versions of the supplied certificate [5.6] and the Satellite you are
about to upgrade to [5.7] do not match.
Upgrade entitlement test PASSED


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