Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 439268

Summary: ipa-addservice throws python exception
Product: [Retired] freeIPA Reporter: Daniel BerrangĂ© <berrange>
Component: ipa-admintoolsAssignee: Rob Crittenden <rcritten>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 1.0CC: mgregg, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-03 14:34:35 UTC Type: ---
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:    
Bug Blocks: 246164, 453489    

Description Daniel Berrangé 2008-03-27 19:33:23 UTC
Description of problem:
# ipa-addservice 
Traceback (most recent call last):
  File "/usr/sbin/ipa-addservice", line 79, in <module>
    except xmlrpclib.Fault, fault:
NameError: name 'xmlrpclib' is not defined


Looking at the code, it appears the 'import xmlrpclib' block is in the wrong
place. It is inside the earlier 'try' statement, so is out of scope when python
tries to process the 'except xmlrpclib' code.

Version-Release number of selected component (if applicable):
ipa-admintools-0.99-12.fc9.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Run   "ipa-addservice"
2.
3.
  
Actual results:


Expected results:
Traceback (most recent call last):
  File "/usr/sbin/ipa-addservice", line 79, in <module>
    except xmlrpclib.Fault, fault:
NameError: name 'xmlrpclib' is not defined


Additional info:

Comment 1 Rob Crittenden 2008-03-27 19:38:49 UTC
Yes, I saw this too in another program. Went a little nuts trying to let the
user hit ^C without seeing a backtrace if they did it during the import stage.

If you move the imports to the top of the file you'll be able to see the root
cause of the failure. Can you do that so I try to tackle that as well?

Comment 2 Daniel Berrangé 2008-03-27 19:54:45 UTC
I had todo several things:

 - Move all the import statements to the top of ipa-addservice
 - Add a missing 'import ldap' statement to ipa.py, or equivalently move 'import
ldap' before 'import ipa'. The former is better though.
 - Install the  'python-ldap'  RPM - a missing Requires:  on ipa-admintools RPM spec

Then i finally got the error i was expecting

# ipa-addservice 
IPA server not found in DNS, in the config file (/etc/ipa/ipa.conf) or on the
command line.


Comment 3 Bug Zapper 2008-05-14 08:20:34 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Rob Crittenden 2008-05-14 15:54:56 UTC
This was fixed upstream as a side-effect of bug 443987.

Comment 6 Michael Gregg 2008-11-20 00:46:19 UTC
Verified against  
1.1.0-2.20081119.el5ipa

[root@ipaqa-64vm ~]# ipa-addservice
usage: ipa-addservice [options] principal

ipa-addservice: error: no principal specified
[root@ipaqa-64vm ~]# echo $?
2