From 0a9229c14fd27925d95613b8256c82bf90892e1e Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Mon, 27 May 2013 17:08:53 +0300 Subject: Pull binary name from sys.argv[0] Instead of inspecting the top of the stack to find the binary name, just use sys.argv[0]. This is little cleaner then inspecting the stack. Co-authored-by: Mark McClain Change-Id: I18d5233b6b0bd0ccaeeab5b7ce5006adcf4a8d40 --- nova/service.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nova/service.py b/nova/service.py index 3731986c4..245640e5e 100644 --- a/nova/service.py +++ b/nova/service.py @@ -19,7 +19,6 @@ """Generic Node base class for all workers that run on hosts.""" -import inspect import os import random import sys @@ -238,7 +237,7 @@ class Service(service.Service): if not host: host = CONF.host if not binary: - binary = os.path.basename(inspect.stack()[-1][1]) + binary = os.path.basename(sys.argv[0]) if not topic: topic = binary.rpartition('nova-')[2] if not manager: -- cgit