From 48c191ffeaf2063a338eec21f9e46878e3204e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Mon, 2 Apr 2012 16:34:48 +0200 Subject: [PATCH] fix TypeError with unstarted threads in nova-network (nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/utils.py", line 860, in __init__ (nova): TRACE: self.tname = "-%x-%x" % (ident & 0xffffffff, gident & 0xffffffff) (nova): TRACE: TypeError: unsupported operand type(s) for &: 'NoneType' and 'int' Fixes: bug 971629 Change-Id: I3d34816c36a11cd6fc2dd9c889c93c5872133a2c --- Authors | 1 + nova/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Authors b/Authors index 82f5d535947c..2c83a3caee15 100644 --- a/Authors +++ b/Authors @@ -73,6 +73,7 @@ Hengqing Hu Hisaharu Ishii Hisaki Ohara Ilya Alekseyev +Ionuț Arțăriși Isaku Yamahata Ivan Kolodyazhny J. Daniel Schmidt diff --git a/nova/utils.py b/nova/utils.py index 29df28ceaf9b..90875dd2512e 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -856,7 +856,7 @@ class GreenLockFile(lockfile.FileLock): t = threading.current_thread() # Thread objects in Python 2.4 and earlier do not have ident # attrs. Worm around that. - ident = getattr(t, "ident", hash(t)) + ident = getattr(t, "ident", hash(t)) or hash(t) gident = corolocal.get_ident() self.tname = "-%x-%x" % (ident & 0xffffffff, gident & 0xffffffff) else: