summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-08-04 12:51:27 -0400
committerDaniil Baturin <daniil@vyos.io>2022-08-04 12:51:27 -0400
commit46173f284cd971c4201969fa9fd35121c7cf7a3a (patch)
treec51c7945432c27bf1186c757a2112a99a30aab27 /src/op_mode
parente199ae2dd5636f9177234bb05b77f4a0c9543428 (diff)
downloadvyos-1x-46173f284cd971c4201969fa9fd35121c7cf7a3a.tar.gz
vyos-1x-46173f284cd971c4201969fa9fd35121c7cf7a3a.zip
T2719: add an exception hierarchy for op mode errors
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/bridge.py2
-rwxr-xr-xsrc/op_mode/conntrack.py2
-rwxr-xr-xsrc/op_mode/container.py2
-rwxr-xr-xsrc/op_mode/cpu.py2
-rwxr-xr-xsrc/op_mode/dns.py2
-rwxr-xr-xsrc/op_mode/ipsec.py2
-rwxr-xr-xsrc/op_mode/memory.py2
-rwxr-xr-xsrc/op_mode/nat.py2
-rwxr-xr-xsrc/op_mode/neighbor.py2
-rw-r--r--src/op_mode/route.py2
-rwxr-xr-xsrc/op_mode/version.py2
-rwxr-xr-xsrc/op_mode/vrf.py2
12 files changed, 12 insertions, 12 deletions
diff --git a/src/op_mode/bridge.py b/src/op_mode/bridge.py
index 411aa06d1..fe8dadd70 100755
--- a/src/op_mode/bridge.py
+++ b/src/op_mode/bridge.py
@@ -197,6 +197,6 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/conntrack.py b/src/op_mode/conntrack.py
index 1441d110f..036226418 100755
--- a/src/op_mode/conntrack.py
+++ b/src/op_mode/conntrack.py
@@ -116,6 +116,6 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/container.py b/src/op_mode/container.py
index 78d42f800..ce466ffc1 100755
--- a/src/op_mode/container.py
+++ b/src/op_mode/container.py
@@ -80,6 +80,6 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/cpu.py b/src/op_mode/cpu.py
index f9c425826..d53663c17 100755
--- a/src/op_mode/cpu.py
+++ b/src/op_mode/cpu.py
@@ -76,7 +76,7 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/dns.py b/src/op_mode/dns.py
index 717652b9b..9e5b1040c 100755
--- a/src/op_mode/dns.py
+++ b/src/op_mode/dns.py
@@ -90,6 +90,6 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/ipsec.py b/src/op_mode/ipsec.py
index 432856585..49c8e6142 100755
--- a/src/op_mode/ipsec.py
+++ b/src/op_mode/ipsec.py
@@ -66,6 +66,6 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/memory.py b/src/op_mode/memory.py
index a3870e498..178544be4 100755
--- a/src/op_mode/memory.py
+++ b/src/op_mode/memory.py
@@ -84,7 +84,7 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/nat.py b/src/op_mode/nat.py
index a98fc4227..12fc4c782 100755
--- a/src/op_mode/nat.py
+++ b/src/op_mode/nat.py
@@ -196,6 +196,6 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/neighbor.py b/src/op_mode/neighbor.py
index d86a372ac..264dbdc72 100755
--- a/src/op_mode/neighbor.py
+++ b/src/op_mode/neighbor.py
@@ -116,7 +116,7 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/route.py b/src/op_mode/route.py
index 3bb06adac..e1eee5bbf 100644
--- a/src/op_mode/route.py
+++ b/src/op_mode/route.py
@@ -92,7 +92,7 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/version.py b/src/op_mode/version.py
index 06208c3e5..ad0293aca 100755
--- a/src/op_mode/version.py
+++ b/src/op_mode/version.py
@@ -78,7 +78,7 @@ if __name__ == '__main__':
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)
diff --git a/src/op_mode/vrf.py b/src/op_mode/vrf.py
index e3d944d90..aeb50fe6e 100755
--- a/src/op_mode/vrf.py
+++ b/src/op_mode/vrf.py
@@ -90,6 +90,6 @@ if __name__ == "__main__":
res = vyos.opmode.run(sys.modules[__name__])
if res:
print(res)
- except ValueError as e:
+ except (ValueError, vyos.opmode.Error) as e:
print(e)
sys.exit(1)