summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@openvz.org>2018-03-16 02:42:42 +0300
committerAndrei Vagin <avagin@openvz.org>2018-03-16 08:16:18 +0300
commit31c46b99e61b6fcfbbc5b277b797cd83270688e4 (patch)
tree567eb89d849c78e7bfb22412d99b81eea20cd4d2 /scripts
parentdf5e4de7fddd182f5655e037124bc758d6af64ff (diff)
downloadtargetcli-31c46b99e61b6fcfbbc5b277b797cd83270688e4.tar.gz
Allow to customize a home directory
In some cases, it looks reasonable to have a separate preference file. For example, we have a set of scripts to configure iscsi targets, and we want to have a separate preference file for these scripts. Signed-off-by: Andrei Vagin <avagin@openvz.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/targetcli4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/targetcli b/scripts/targetcli
index 7c549e6..b042ad9 100755
--- a/scripts/targetcli
+++ b/scripts/targetcli
@@ -20,7 +20,7 @@ under the License.
from __future__ import print_function
-from os import getuid
+from os import getuid, getenv
from targetcli import UIRoot
from rtslib_fb import RTSLibError
from configshell_fb import ConfigShell, ExecutionError
@@ -75,7 +75,7 @@ def main():
else:
is_root = False
- shell = TargetCLI('~/.targetcli')
+ shell = TargetCLI(getenv("TARGETCLI_HOME", '~/.targetcli'))
try:
root_node = UIRoot(shell, as_root=is_root)