summaryrefslogtreecommitdiff
path: root/targetcli/ui_node.py
diff options
context:
space:
mode:
authorJerome Martin <jxm@risingtidesystems.com>2012-05-08 15:19:42 +0200
committerJerome Martin <jxm@risingtidesystems.com>2012-05-08 15:26:15 +0200
commitdf8a37c8deeca3c085a6365fef44441cb6f95486 (patch)
tree8b3fdf7b848bfce1fa2f9f4ede90c5d882e4a635 /targetcli/ui_node.py
parentcc09fda40801f193441ee97ab892fd66b9441339 (diff)
downloadtargetcli-df8a37c8deeca3c085a6365fef44441cb6f95486.tar.gz
Skip unsaved config check on exit when not root
* A warning would be nice but lio_dump needs root privileges.
Diffstat (limited to 'targetcli/ui_node.py')
-rw-r--r--targetcli/ui_node.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/targetcli/ui_node.py b/targetcli/ui_node.py
index 0749899..d6cae64 100644
--- a/targetcli/ui_node.py
+++ b/targetcli/ui_node.py
@@ -21,6 +21,7 @@ from configshell import ConfigNode, ExecutionError
from rtslib import RTSLibError, RTSRoot
from subprocess import PIPE, Popen
from os.path import isfile
+from os import getuid
def exec3(cmd):
'''
@@ -121,7 +122,7 @@ class UINode(ConfigNode):
config_needs_save = True
break
- if config_needs_save:
+ if config_needs_save and getuid() == 0:
self.shell.con.display("There are unsaved configuration changes.\n"
"If you exit now, configuration will not "
"be updated and changes will be lost upon "