summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJerome Martin <jxm@risingtidesystems.com>2011-05-14 15:54:32 +0200
committerJerome Martin <jxm@risingtidesystems.com>2011-05-14 19:19:27 +0200
commit51d0f2d7558f7d2f0453b2e6c502de1a47c9e43d (patch)
tree7aba0340ac001d6e8c4aeeefe53116283059c3c3 /scripts
parent21867ef795fcf985a6ae97f7d97572fbb4f4fd64 (diff)
downloadtargetcli-51d0f2d7558f7d2f0453b2e6c502de1a47c9e43d.tar.gz
Cleanly abort startup if RTSLibError happens.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rtsadmin9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/rtsadmin b/scripts/rtsadmin
index a365b94..3601cc5 100755
--- a/scripts/rtsadmin
+++ b/scripts/rtsadmin
@@ -22,6 +22,7 @@ All rights reserved.
from os import getuid
from rtsadmin import UIRoot
+from rtslib import RTSLibError
from configshell import ConfigShell
class RTSAdmin(ConfigShell):
@@ -62,8 +63,12 @@ def main():
shell.con.display('You are not root, disabling privileged commands.')
shell.con.display('')
- root_node.refresh()
- shell.run_interactive()
+ try:
+ root_node.refresh()
+ except RTSLibError, error:
+ shell.con.display(shell.con.render_text(str(error), 'red'))
+ else:
+ shell.run_interactive()
if __name__ == "__main__":
main()