From 780d39e549df18d40eb01e4ff07c2274ab72d720 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Sun, 06 Jan 2013 00:22:17 +0000 Subject: Define os_info outside the try block Otherwise if an exception israised it will be undefined. --- diff --git a/devbot/plugins/ubuntu.py b/devbot/plugins/ubuntu.py index dd0efde..b56278e 100644 --- a/devbot/plugins/ubuntu.py +++ b/devbot/plugins/ubuntu.py @@ -26,9 +26,10 @@ class DistroInfo(interfaces.DistroInfo): elif arch == "x86_64": self.lib_dir = "lib/x86_64-linux-gnu" + os_info = {} + try: release = open(self._OS_RELEASE_PATH).read().strip() - os_info = {} for line in release.split("\n"): split = line.strip().split("=") os_info[split[0]] = split[1].replace("\"", "") -- cgit v0.9.1