From e0eebb2ff2fa3f7253f78231475a6aa734b0621d Mon Sep 17 00:00:00 2001 From: Christopher Boumenot Date: Tue, 12 Dec 2017 12:06:02 -0800 Subject: [PATCH] review feedback --- azurelinuxagent/pa/provision/default.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azurelinuxagent/pa/provision/default.py b/azurelinuxagent/pa/provision/default.py index 94647df..5d6f156 100644 --- a/azurelinuxagent/pa/provision/default.py +++ b/azurelinuxagent/pa/provision/default.py @@ -282,7 +282,8 @@ class ProvisionHandler(object): count = len([x for x in open('/proc/cpuinfo').readlines() if x.startswith("processor")]) return count - except: + except Exception as e: + logger.verbose(u"Failed to determine the CPU count: {0}.", ustr(e)) pass return -1 @@ -292,7 +293,8 @@ class ProvisionHandler(object): m = re.match('^MemTotal:\s*(\d+) kB$', line) if m is not None: return int(int(m.group(1)) / 1024) - except: + except Exception as e: + logger.verbose(u"Failed to determine the memory size: {0}..", ustr(e)) pass return -1