Fix warnings in doc build for apiclient

There was some invalid rst in the docstrings for apiclient which
caused several warnings during the doc build and also rendering
issues.

Closes-Bug: #1315523
Change-Id: I98c6061241eb462df4f78054b25a8920da6bcfd7
Fix update.py can't replace base name

update.py scans 'from openstack.common.*' to replace base name while
syncing, there is another import style 'import openstack.common.*'.
This patch handles this case.

Closes-Bug: #1304774
Change-Id: I29caef5faff2ec7b2eebd5c61bcf39f91e6e9265
Document config generator variables

Add a small paragraph explaning the configuration of the config
generator wrapper script.

Change-Id: Ibddcb85d45f419c4034c4d00434b7fdf8c24d8ae
remove token from notifier middleware

notifier middleware is capturing token and sending it to MQ. this
is not advisable so we should filter it out.

Change-Id: Ia1bfa1bd24989681db1d2f385defc12e69a01f8d
Closes-Bug: #1321080
Make unspecified periodic spaced tasks run on default interval

When there are multiple tasks with a defined spacing, they can get
somewhat staggered and force the periodic task processor to run
additional iterations. Since tasks with no spacing run every time the
periodic task processor runs, they get run more frequently than one
would expect.

Some may argue that this change in behavior could cause some task to
behave differently than it used to. However, there was never any
guarantee that the task would run more often than every 60 seconds, and
in many cases the tasks may already run less frequently than that (due
to other long-running tasks). So this change should not introduce any
new issues related to the timing of task execution; it would only serve
to make the timing more regular.

We should also make the default interval configurable but that's
reserved for a separate change.

DocImpact: periodic tasks without a specific spacing interval will now
run on the default interval (currently every 60 seconds) rather than
whenever the task processor runs.

UpgradeImpact: see above; periodic tasks without a specific spacing
interval will now run on the default interval which may be less
often than some tasks run now, but with this change they will run
on a more consistent interval.

Closes-Bug: #1319232
Related-Bug: #1276203
Related-Bug: #1272830

Change-Id: I4dd20f68175165d311fa4d3f459c86f2dcac911b
Merge "remove token from notifier middleware"
Merge "Make unspecified periodic spaced tasks run on default interval"
Fix logging setup for Python 3.4

The logging.getLevelName is supposed to be used to get string
representation from integer code, not vice versa. It is possible to get
int code from the string using this function in Python 2, but not in
Python 3.4, where for example getLevelName('DEBUG') will return
'Level DEBUG' instead of 10.
Only in Python2.6, Logger.setLevel doesn't do automatic
conversion, and thus requires call to getLevelName.

Closes-bug: #1322701
Change-Id: I4500681e842f0c1799931407fa66c660bdaf2d41
Enforce unicode json output for jsonutils.load[s]()

simplejson module applies some optimizations on ASCII-only unicode
strings which result in non-unicode json output. See details at [1]
and [2]. To make sure we always return consistent json output no
matter which json implementation is used, we should explicitly convert
the input for json.load[s]() to unicode.

If user wants to pass a file object of non UTF-8 encoding to
json.load[s](), she must also specify this encoding as an argument. To
support this scenario too, we've added 'encoding' argument to
jsonutils.load[s]() implementation.

Made all present JSON tests to run on both supported json library
implementations.

Added explicit dependency for simplejson to be able to test different
implementations in unit tests. Distributors still running Python 2.6
are recommended but not required to install simplejson.

Related-Bug: 1314129

[1]: https://code.djangoproject.com/ticket/11742
[2]: https://code.google.com/p/simplejson/issues/detail?id=40

Change-Id: Ic815ca3df94c33edec9104172048b2cd94b92e3f
fileutils: port to Python 3

Blueprint: make-python3-compatible

Change-Id: Ie27686dba03e0a0706c0a5641ec48c18450123b1
Remove redundant default=None for config options

The cfg module sets the default values as None by default. There
is no need to set this again.

The default is set as None:
http://docs.openstack.org/developer/oslo.config/opts.html#oslo.config.cfg.Opt

Change-Id: I5ab948b1571e51d05f6eb9f35720d0eecc3a56ab
Fix docstring indentation in systemd

This gives overwise an error when building Sphinx documentation:

docstring of keystone.openstack.common.systemd.notify:3: ERROR:
Unexpected indentation.

Fix another small docstring formatting error alongway.

Change-Id: I403dacfcb65c1dbffc12edf102a36b3177eb944c
Merge "Fix update.py can't replace base name"
Merge "Document config generator variables"
Merge "Enforce unicode json output for jsonutils.load[s]()"
Remove ValueError when accessing sys.modules

Previously there was ValueError that cannot be raised either by
__import__() nor getattr(). I think the original idea was to have KeyError
in order to catch exception when module is not part of sys.modules.

Since there is __import__ prior to getting class from sys.modules, there
is eliminated a chance of raising KeyError when getting key from
sys.modules. Either __import__ raises exception or import is successful
and module is present in sys.modules.

Change-Id: I1344a9e9d544b0c48e36f96be5b01911a7ec5497
Merge "Fix logging setup for Python 3.4"
Merge "Remove ValueError when accessing sys.modules"
Merge "Fix docstring indentation in systemd"
Merge "Remove redundant default=None for config options"