freeipa/ipapython
John Dennis 2bf68115ce Ticket #2850 - Ipactl exception not handled well
Ticket #2850 - Ipactl exception not handled well

There were various places in ipactl which intialized IpactlError with
None as the msg. If you called str() on that exception all was well
because ScriptError.__str__() converted a msg with None to the empty
string (IpactlError is subclassed from ScriptError). But a few places
directly access e.msg which will be None if initialized that way. It's
hard to tell from the stack traces but I'm pretty sure it's those
places which use e.msg directly which will cause the problems seen in
the bug report.

I do not believe it is ever correct to initialize an exception message
to None, I don't even understand what that means. On the other hand
initializing to the empty string is sensible and for that matter is
the default for the class.

This patch makes two fixes:

1) The ScriptError initializer will now convert a msg parameter of
None to the empty string.

2) All places that initialized IpactlError's msg parameter to None
removed the None initializer allowing the msg parameter to default
to the empty string.

I don't know how to test the fix for Ticket #2850 because it's not
clear how it got into that state in the first place, but I do believe
initialing the msg value to None is clearly wrong and should fix the
problem.
2012-08-27 15:30:28 +02:00
..
platform Create /etc/sysconfig/network if it doesn't exist 2012-08-03 12:09:56 +02:00
py_default_encoding Check for Python.h during build of py_default_encoding extension 2011-11-16 18:34:16 -05:00
test Fix failed tests. API for utcoffset changed and strings are more robust. 2011-01-24 14:34:38 -05:00
__init__.py Rename ipa-python directory to ipapython so it is a real python library 2009-02-09 14:35:15 -05:00
admintool.py Ticket #2850 - Ipactl exception not handled well 2012-08-27 15:30:28 +02:00
certdb.py Move the compat module from ipalib to ipapython. 2012-02-13 22:22:49 -05:00
certmonger.py Use certmonger to renew CA subsystem certificates 2012-07-30 13:39:08 +02:00
compat.py Move the compat module from ipalib to ipapython. 2012-02-13 22:22:49 -05:00
config.py Fix winsync agreements creation 2012-08-12 23:26:16 -04:00
dn.py Ticket #3008: DN objects hash differently depending on case 2012-08-22 17:23:12 +03:00
dogtag.py Add the -v option to sslget to provide more verbose errors 2012-02-23 11:26:06 +01:00
entity.py Use DN objects instead of strings 2012-08-12 16:23:24 -04:00
ipa_log_manager.py Use DN objects instead of strings 2012-08-12 16:23:24 -04:00
ipa.conf Rename ipa-python directory to ipapython so it is a real python library 2009-02-09 14:35:15 -05:00
ipautil.py Use DN objects instead of strings 2012-08-12 16:23:24 -04:00
ipavalidate.py Change FreeIPA license to GPLv3+ 2010-12-20 17:19:53 -05:00
kernel_keyring.py Store session cookie in ccache for cli users 2012-06-14 14:02:26 +02:00
log_manager.py Restore default log level in server to INFO 2011-12-01 08:34:02 +01:00
Makefile Introduce platform-specific adaptation for services used by FreeIPA. 2011-09-13 11:25:58 +02:00
MANIFEST.in Rename ipa-python directory to ipapython so it is a real python library 2009-02-09 14:35:15 -05:00
nsslib.py Improve address family handling in sockets 2012-07-13 14:25:18 +02:00
README Replace DNS client based on acutil with python-dns 2012-05-24 13:55:56 +02:00
services.py.in If SELinux is enabled ensure we also have restorecon. 2012-05-31 14:07:05 +02:00
setup.py.in Introduce platform-specific adaptation for services used by FreeIPA. 2011-09-13 11:25:58 +02:00
sysrestore.py Add sysupgrade state file 2012-06-10 21:23:10 -04:00
version.py.in Add API version and have server reject incompatible clients. 2011-01-14 14:26:22 -05:00

This is a set of libraries common to IPA clients and servers though mostly
geared currently towards command-line tools.

A brief overview:

config.py - identify the IPA server domain and realm. It uses python-dns to
            try to detect this information first and will fall back to
            /etc/ipa/default.conf if that fails.

ipautil.py - helper functions

entity.py - entity is the main data type. User and Group extend this class
            (but don't add anything currently).

ipavalidate.py - basic data validation routines