diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-11-13 07:12:25 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-11-13 07:12:25 -0500 |
commit | 20895b7d21c12a067e7da39e6a2b85afc1cda114 (patch) | |
tree | 73abeedb9715d76dbccaeba1a5b3874c6c9dbda1 /src/lib/Bcfg2/Server | |
parent | 8e26ccb6a12d070b78d97fe1db6e2925285d7f1a (diff) | |
download | bcfg2-20895b7d21c12a067e7da39e6a2b85afc1cda114.tar.gz bcfg2-20895b7d21c12a067e7da39e6a2b85afc1cda114.tar.bz2 bcfg2-20895b7d21c12a067e7da39e6a2b85afc1cda114.zip |
Multiprocessing: stringify server core safely before options are parsed
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r-- | src/lib/Bcfg2/Server/MultiprocessingCore.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/MultiprocessingCore.py b/src/lib/Bcfg2/Server/MultiprocessingCore.py index aba73c273..294963669 100644 --- a/src/lib/Bcfg2/Server/MultiprocessingCore.py +++ b/src/lib/Bcfg2/Server/MultiprocessingCore.py @@ -333,8 +333,12 @@ class MultiprocessingCore(BuiltinCore): self.children = None def __str__(self): - return "%s(%s; %s children)" % (self.__class__.__name__, - Bcfg2.Options.setup.location, + if hasattr(Bcfg2.Options.setup, "location"): + return "%s(%s; %s children)" % (self.__class__.__name__, + Bcfg2.Options.setup.location, + len(self._all_children)) + else: + return "%s(%s children)" % (self.__class__.__name__, len(self._all_children)) def _run(self): |