From 31c46b99e61b6fcfbbc5b277b797cd83270688e4 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 16 Mar 2018 02:42:42 +0300 Subject: 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 --- scripts/targetcli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') 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) -- cgit v1.2.1