From: Steven Dake Date: Wed, 18 Jul 2012 00:38:50 +0000 (-0700) Subject: Update openstack-common X-Git-Tag: 2014.1~1585 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=97d8118f6e9a072e93e0ac59c6c614aff739afed;p=openstack-build%2Fheat-build.git Update openstack-common Change-Id: I2d7e169adb9205faa109634a9ae15a9f34e4bd75 Signed-off-by: Steven Dake --- diff --git a/heat/openstack/common/iniparser.py b/heat/openstack/common/iniparser.py index e91eea53..24128444 100644 --- a/heat/openstack/common/iniparser.py +++ b/heat/openstack/common/iniparser.py @@ -53,7 +53,8 @@ class BaseParser(object): key, value = line[:colon], line[colon + 1:] value = value.strip() - if value[0] == value[-1] and value[0] == "\"" or value[0] == "'": + if ((value and value[0] == value[-1]) and + (value[0] == "\"" or value[0] == "'")): value = value[1:-1] return key.strip(), [value] diff --git a/heat/openstack/common/jsonutils.py b/heat/openstack/common/jsonutils.py index 11b7e1ef..845023eb 100644 --- a/heat/openstack/common/jsonutils.py +++ b/heat/openstack/common/jsonutils.py @@ -39,6 +39,8 @@ import itertools import json import xmlrpclib +from heat.openstack.common import timeutils + def to_primitive(value, convert_instances=False, level=0): """Convert a complex object into primitives. @@ -101,7 +103,7 @@ def to_primitive(value, convert_instances=False, level=0): level=level) return o elif isinstance(value, datetime.datetime): - return str(value) + return timeutils.strtime(value) elif hasattr(value, 'iteritems'): return to_primitive(dict(value.iteritems()), convert_instances=convert_instances, diff --git a/heat/openstack/common/rpc/impl_zmq.py b/heat/openstack/common/rpc/impl_zmq.py index 71bc8f2f..00296dd3 100644 --- a/heat/openstack/common/rpc/impl_zmq.py +++ b/heat/openstack/common/rpc/impl_zmq.py @@ -63,9 +63,10 @@ zmq_opts = [ cfg.StrOpt('rpc_zmq_ipc_dir', default='/var/run/openstack', help='Directory for holding IPC sockets'), + cfg.StrOpt('rpc_zmq_host', default=socket.gethostname(), help='Name of this node. Must be a valid hostname, FQDN, or ' - 'IP address') + 'IP address. Must match "host" option, if running Nova.') ] @@ -130,7 +131,7 @@ class ZmqSocket(object): 'subscribe': subscribe, 'bind': bind} LOG.debug(_("Connecting to %(addr)s with %(type)s"), str_data) - LOG.debug(_("-> Subscribed to %(subscribe)s"), str_data) + LOG.debug(_("-> Subscribed to %(subscribe)s"), str_data) LOG.debug(_("-> bind: %(bind)s"), str_data) try: @@ -719,3 +720,6 @@ def register_opts(conf): mm_impl = importutils.import_module(mm_module) mm_constructor = getattr(mm_impl, mm_class) matchmaker = mm_constructor() + + +register_opts(cfg.CONF)