10. Appendix

This section contains information that is referenced from other sections, and that does not really need to be read in sequence.

10.1. Special type names

This documentation uses a few special terms to refer to Python types:

string
a unicode string or a byte string
unicode string
a Unicode string type (unicode in Python 2, and str in Python 3)
byte string
a byte string type (str in Python 2, and bytes in Python 3). Unless otherwise indicated, byte strings in pywbem are always UTF-8 encoded.
number
one of the number types int, long (Python 2 only), or float.
integer
one of the integer types int or long (Python 2 only).
callable
a type for callable objects (e.g. a function, calling a class returns a new instance, instances are callable if they have a __call__() method).
DeprecationWarning
a standard Python warning that indicates a deprecated functionality. See section Deprecation policy and the standard Python module warnings for details.
Element
class xml.dom.minidom.Element. Its methods are described in section Element Objects of module xml.dom, with minidom specifics described in section DOM Objects of module xml.dom.minidom.
CIM data type
one of the types listed in CIM data types.
CIM object
one of the types listed in CIM objects.

10.2. Troubleshooting

Here are some trouble shooting hints for the installation of pywbem.

10.2.1. AttributeError for NullHandler during mkvirtualenv on Python 2.6

If the mkvirtualenv command fails on Python 2.6 with this error:

File "/usr/lib/python2.6/site-packages/stevedore/__init__.py", line 23,
  in <module> LOG.addHandler(logging.NullHandler())
AttributeError: 'module' object has no attribute 'NullHandler'

then the stevedore PyPI package is too recent(!) The owners of that package spent effort to remove the previously existing Python 2.6 support in some steps, starting with stevedore v1.10.

The solution is to use stevedore v1.9. Note that for virtualenvwrapper to use it, it must be installed into the system Python:

$ sudo pip install stevedore==1.9

10.2.2. TypeError about StreamHandler argument ‘stream’ during mkvirtualenv on Python 2.6

If the mkvirtualenv command fails on Python 2.6 with this error:

File "/usr/lib/python2.6/site-packages/virtualenvwrapper/hook_loader.py",
  line 101, in main
console = logging.StreamHandler(stream=sys.stderr)
TypeError: __init__() got an unexpected keyword argument 'stream'

then the virtualenvwrapper PyPI package is too old. As of its released version v4.7.1, a fix for that is in the master branch of its repository and has not been released yet.

While a new version of virtualenvwrapper with the fix is not yet released, a solution is to clone the virtualenvwrapper repository and to install it from its working directory. Note that it must be installed into the system Python:

$ git clone https://bitbucket.org/dhellmann/virtualenvwrapper.git virtualenvwrapper
$ cd virtualenvwrapper
$ sudo python setup.py install

10.2.3. Swig error ‘Unrecognized option -builtin’ during M2Crypto install

On Python 2.x, pywbem uses the M2Crypto package from PyPI and installs it during its own installation. The M2Crypto package invokes the Swig tool during its installation. If the version of Swig is too old, the invocation of Swig fails with:

swig error : Unrecognized option -builtin

The solution is to use Swig v2.0 or higher.

The pywbem setup script checks the version of Swig and installs a newer version of Swig, or if not available builds Swig from its sources (while automatically installing any further OS-level prerequisites needed for building Swig).

10.2.4. gcc does not find Python.h while installing M2Crypto

On Python 2.x, pywbem uses the M2Crypto package from PyPI and installs it during its own installation. The M2Crypto package invokes the Swig tool during its installation. Swig invokes the gcc compiler on source code it produces. That source code needs the Python.h header file.

If the invocation of gcc fails with:

SWIG/_m2crypto_wrap.c:127:20: fatal error: Python.h: No such file or directory

then you do not have the Python.h header file available.

The installation of pywbem with OS-level prereqs (see Installation) installs the necessary Python SDK package for C/C++ (or displays its package name). On RHEL, the missing package is python-dev. For more details, see Prerequisite operating system packages.

10.2.5. Pip install of M2CryptoWin32 fails with option not recognized

In native Windows with a 32-bit version of Python, the following error has been observed when attempting to install the M2CryptoWin32 package:

> pip install M2CryptoWin32
. . .
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized

This has been reported to be fixed by installing the Python wheel package into the active Python environment, and repeating the installation:

> pip install wheel
> pip install M2CryptoWin32

10.3. Glossary

dynamic indication filter
dynamic filter
An indication filter in a WBEM server whose life cycle is managed by a client. See DSP1054 for an authoritative definition and for details.
static indication filter
static filter
An indication filter in a WBEM server that pre-exists and whose life cycle cannot be managed by a client. See DSP1054 for an authoritative definition and for details.