summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Tools/APT.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-11-17 00:58:04 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2015-11-17 15:00:20 +0100
commit2d2a3905ca48622e0e974176e0a5bbd739c7c8fa (patch)
tree244f690e184acc034066dbdca686b3947249ad67 /src/lib/Bcfg2/Client/Tools/APT.py
parent0462f31b4243d8cde088f121e519c5db4d6c982f (diff)
downloadbcfg2-2d2a3905ca48622e0e974176e0a5bbd739c7c8fa.tar.gz
bcfg2-2d2a3905ca48622e0e974176e0a5bbd739c7c8fa.tar.bz2
bcfg2-2d2a3905ca48622e0e974176e0a5bbd739c7c8fa.zip
Client/Tools: Fix error if no pkg handled
Install() of a client tool returns the changed states as dict, that will update the global state. If nothing is handled withing a tool, it have to return an empty dict and not None because the return value is directly used as argument for update: > APT.Install() call failed: > Traceback (most recent call last): > File "/usr/lib/python2.7/dist-packages/Bcfg2/Client/__init__.py", line 739, in DispatchInstallCalls > self.states.update(tool.Install(handled)) > TypeError: 'NoneType' object is not iterable
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools/APT.py')
-rw-r--r--src/lib/Bcfg2/Client/Tools/APT.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/APT.py b/src/lib/Bcfg2/Client/Tools/APT.py
index abc76ef1c..9b3dded99 100644
--- a/src/lib/Bcfg2/Client/Tools/APT.py
+++ b/src/lib/Bcfg2/Client/Tools/APT.py
@@ -236,7 +236,7 @@ class APT(Bcfg2.Client.Tools.Tool):
self.logger.error("Cannot find correct versions of packages:")
self.logger.error(bad_pkgs)
if not ipkgs:
- return
+ return dict()
if not self.cmd.run(self.pkgcmd % (" ".join(ipkgs))):
self.logger.error("APT command failed")
self.pkg_cache = apt.cache.Cache()