From 4c39545bbeb661c564b392fe3ff28fab2713a53e Mon Sep 17 00:00:00 2001 From: mkaay Date: Sun, 13 Feb 2011 20:45:33 +0100 Subject: collector size --- module/remote/thriftbackend/Handler.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'module/remote/thriftbackend/Handler.py') diff --git a/module/remote/thriftbackend/Handler.py b/module/remote/thriftbackend/Handler.py index 6e1377938..91848941b 100644 --- a/module/remote/thriftbackend/Handler.py +++ b/module/remote/thriftbackend/Handler.py @@ -191,7 +191,11 @@ class Handler(Iface): Parameters: - fid """ - rawData = self.serverMethods.get_file_data(fid).values()[0] + rawData = self.serverMethods.get_file_data(fid) + if rawData: + rawData = rawData.values()[0] + else: + return None fdata = self._convertPyFile(rawData) return fdata @@ -372,7 +376,7 @@ class Handler(Iface): packs = self.serverMethods.get_collector() for pid in packs: pack = self.serverMethods.get_package_data(pid) - while pack["order"] in order.keys(): + while pack["order"] in order.keys(): #just in case pack["order"] += 1 order[pack["order"]] = pack["id"] return order @@ -385,6 +389,8 @@ class Handler(Iface): rawData = self.serverMethods.get_package_data(pid) order = {} for pyfile in rawData["links"]: + while pyfile["order"] in order.keys(): #just in case + pyfile["order"] += 1 order[pyfile["order"]] = pyfile["id"] return order -- cgit v1.2.3