]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Update openstack-common
authorSteven Dake <sdake@redhat.com>
Wed, 18 Jul 2012 00:38:50 +0000 (17:38 -0700)
committerSteven Dake <sdake@redhat.com>
Wed, 18 Jul 2012 00:38:50 +0000 (17:38 -0700)
Change-Id: I2d7e169adb9205faa109634a9ae15a9f34e4bd75
Signed-off-by: Steven Dake <sdake@redhat.com>
heat/openstack/common/iniparser.py
heat/openstack/common/jsonutils.py
heat/openstack/common/rpc/impl_zmq.py

index e91eea5380fa4e88a070ede2971bcacfea5107a7..241284449e32c0be0200df6eec92b46b632d4cca 100644 (file)
@@ -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]
 
index 11b7e1efb54d78b7a08cff9f9e80732a0e666296..845023eba89088090b4c4beee626699dc9f79481 100644 (file)
@@ -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,
index 71bc8f2f4e1d6f9b3a0aefddd5f082e2ed3a5a02..00296dd33660af521626f633812717f1798fe6a7 100644 (file)
@@ -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)