If there's a pool directory set in the system wide configuration file
it is overwritten on the first run of lnst-ctl. The patch changes this
behavior so that the user's pool directory is used only if the system
wide config does not set the pool directory.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst-ctl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lnst-ctl b/lnst-ctl
index f63f610..282bfe3 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -152,7 +152,9 @@ def main():
usr_cfg_dir = os.path.dirname(usr_cfg)
pool_dir = usr_cfg_dir + "/pool"
mkdir_p(pool_dir)
- lnst_config.set_option("environment", "pool_dirs",
[pool_dir])
+ global_pool = lnst_config.get_option("environment",
"pool_dirs")
+ if (len(global_pool) == 0):
+ lnst_config.set_option("environment", "pool_dirs",
[pool_dir])
with open(usr_cfg, 'w') as f:
f.write(lnst_config.dump_config())
--
1.9.3
Show replies by thread