pep8 cleanup in the plugin code

The nova hacking test turned up one alphabetization error
that I missed previously.  Also, our path-altering
process caused one line to exceed 80 characters
when copied into nova; that line is shorter now.

Change-Id: Ia3acfc25ecc5ba388526766dae3ed03792e906e3
Minor pep8 cleanup in rpc.

Removed a space, reordered an import.

Change-Id: I418d1f7c6a5a3b8ef231c88b4ef28114ca0eb7cd
Restore register_opts on impl_zmq module load

Change-Id: I6acdf1445e1f03246476292b38d7c52a29934af1
Add additional usage info on rpc_zmq_host flag

Change-Id: I8f1f3b42de7253c993e2afa44ed1c0ad4dbbb74f
Merge "pep8 cleanup in the plugin code"
Merge "Minor pep8 cleanup in rpc."
Merge "Restore register_opts on impl_zmq module load"
Merge "Add additional usage info on rpc_zmq_host flag"
Use strtime() in to_primitive() for datetime objs.

This patch updates jsonutils.to_primitive() to use timeutils.strtime()
to convert a datimetime object to a string instead of just using str().
This ensures that we can easily convert the string back to a datetime
using timeutils.parse_strtime().

Required for the nova blueprint no-db-messaging.

Change-Id: I725b333695930e12e2832378102514326fec639c
Don't switch to list_notifier unless necessary.

Some notification tests depend on a different, single notifier being
used. So, don't switch to the list notifier just because we loaded
this class; only switch if an actual plugin needs it.

Also: improved the test that makes sure all this notifier-switching
doesn't break the notifier that was present in the first place.

Change-Id: I170477bccb3ad9505fe6dbfbc214f77c09f6862f
cfg: allow empty config values

Fixes bug #1025522

Commit 83044a7 caused this to stop working in Quantum:

  api_extensions_path =

and could only be worked around with:

  api_extensions_path = ""

Change-Id: I8c1a57225a2c135e6baf567b8e71d61e974da4e2
Add test-options from Nova /w pyzmq

Change-Id: Ieebefee89483e5abbcefe1bb9059d89c91dc04df
fix bug lp:1019348,update openstack-common to support pep8 1.3.

also,this patch turns off pep8 E125 check.

Change-Id: I22d2a94d89530586d614af39af17ae542c5e0cbf
Update iteritems test case to actually test iteritems.

This patch updates the jsonutils.to_primitive() test case for when an
object has an iteritems() method.  The previous implementation was
mostly a copy of another test and didn't actually test calling
iteritems() at all.  Now it does.

This is used by NovaBase in nova.db.sqlalchemy.models.

Related to nova blueprint no-db-messaging.

Change-Id: Ie1d71b859219392ab35b82dd3c7932b30e759c89
Track to_primitive() depth after iteritems().

Change jsonutils.to_primitive() to increase the recursion depth counter
when calling to_primitive() on the result of iteritems() from the
current element.  Previously, the only time the counter was increased
was when converting the __dict__ from an object.  The iteritems() case
risks cycles, as well.

I hit a problem with this when trying to call to_primitive on an
instance of nova.db.sqlalchemy.models.Instance.  An Instance includes a
reference to InstanceInfoCache, which has a reference back to the
Instance.  Without this change, to_primitive() would raise an exception
for an Instance due to excessive recursion.

Related to nova blueprint no-db-messaging.

Change-Id: Ifb878368d97e92ab6c361a4dd5f5ab2e68fc16e2
Add missing convert_instances arg.

When calling jsonutils.to_primitive() recursively, the convert_instances
argument should be passed along.  This change fixes one place where it
was not.

Change-Id: I536e1ca05bb4e613fba71298797879587e8b4b00
Merge "Add test-options from Nova /w pyzmq"
Make test_zmq bind/send to 127.0.0.1

By default, the impl_zmq driver binds to '*' (0.0.0.0);
For the purposes of testing, we only need to bind to 127.0.0.1.
Binding to all interfaces could be potentially dangerous, may simply not
work in some environments, etc. In particular, we do not want our
Jenkins slaves to be listening on public interfaces.

rpc_zmq_host is set to 127.0.0.1 as well, which avoids hostname
resolution. Normally, rpc_zmq_host is set to socket.hostname, which
normally should resolve to localhost, but we do not want to test that here.

Change-Id: I1224799bb399ceaf79088dd622be4b6823f29a41
Enable fanout_cast and fanout_cast_to_server to provide topic

The code would make use of the self.topic instead of allowing
the user to define the topic.

Change-Id: Ibdd4fab6dd019d223c3256d70f123829939056d2
Merge "Make test_zmq bind/send to 127.0.0.1"