From 2d2a3905ca48622e0e974176e0a5bbd739c7c8fa Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 17 Nov 2015 00:58:04 +0100 Subject: 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 --- src/lib/Bcfg2/Client/Tools/APT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Client/Tools/APT.py') 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() -- cgit v1.2.3-1-g7c22