Update openstack-common

Change-Id: I2d7e169adb9205faa109634a9ae15a9f34e4bd75
Signed-off-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Steven Dake 2012-07-17 17:38:50 -07:00
parent 3a4f222526
commit 97d8118f6e
3 changed files with 11 additions and 4 deletions

View 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]

View 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,

View 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)