From f90e6f2f5b02d07afa8c2fab9f5b44956913c1af Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 23 Jan 2017 10:23:18 +0100 Subject: [PATCH] Fix an error if you don't have permissions on your symbols directory Fix #872 --- gns3server/controller/symbols.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/symbols.py b/gns3server/controller/symbols.py index 73c6a553..389f3ac0 100644 --- a/gns3server/controller/symbols.py +++ b/gns3server/controller/symbols.py @@ -29,7 +29,10 @@ class Symbols: """ def __init__(self): - self.list() + try: + self.list() + except OSError: # The error will be raised and forward later + pass # Keep a cache of symbols size self._symbol_size_cache = {} @@ -79,7 +82,7 @@ class Symbols: return self._symbols_path[symbol_id] except KeyError: return self._symbols_path[":/symbols/computer.svg"] - + def get_size(self, symbol_id): try: return self._symbol_size_cache[symbol_id]