aboutsummaryrefslogtreecommitdiff
path: root/vland.py
diff options
context:
space:
mode:
Diffstat (limited to 'vland.py')
-rwxr-xr-xvland.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/vland.py b/vland.py
index 0822af6..8c87d35 100755
--- a/vland.py
+++ b/vland.py
@@ -30,7 +30,7 @@ sys.path.insert(0, vlandpath)
from config.config import VlanConfig
from db.db import VlanDB
from ipc.ipc import VlanIpc
-from errors import InputError, SocketError
+from errors import InputError, NotFoundError, SocketError
from util import VlanUtil
from visualisation.visualisation import Visualisation
@@ -148,6 +148,10 @@ while state.running:
print e
response['response'] = 'ERROR'
response['error'] = e.__str__()
+ except NotFoundError as e:
+ print e
+ response['response'] = 'NOTFOUND'
+ response['error'] = e.__str__()
# Next - simple queries about daemon state only. Should be safe!
if json_data['type'] == 'daemon_query':
@@ -159,6 +163,10 @@ while state.running:
print e
response['response'] = 'ERROR'
response['error'] = e.__str__()
+ except NotFoundError as e:
+ print e
+ response['response'] = 'NOTFOUND'
+ response['error'] = e.__str__()
# Next, calls that manipulate objects in the database only
# (switches and ports). These are safe and don't need actual
@@ -175,6 +183,10 @@ while state.running:
print e
response['response'] = 'ERROR'
response['error'] = e.__str__()
+ except NotFoundError as e:
+ print e
+ response['response'] = 'NOTFOUND'
+ response['error'] = e.__str__()
# Next, calls that may manipulate switch state *as well* as state
# in the database - changes to VLAN setup.
@@ -190,6 +202,10 @@ while state.running:
print e
response['response'] = 'ERROR'
response['error'] = e.__str__()
+ except NotFoundError as e:
+ print e
+ response['response'] = 'NOTFOUND'
+ response['error'] = e.__str__()
# Finally, IPC interface for more complex API calls.
# NOT IMPLEMENTED YET