From 100b38128a039d04f1eebe8fb7c2a0c7d63cf9af Mon Sep 17 00:00:00 2001
From: Marc Gariepy <gariepy.marc@gmail.com>
Date: Thu, 7 Sep 2017 10:58:14 -0400
Subject: [PATCH] Echo warning to export TODOLIST var.

In case the scripts are run independently and not via run-stages.sh
some vars are not set for script execution and the deployer need to
export a new env var.

Change-Id: I4f24478d92563f5c00fefce269120f1b908aedcd
---
 leap-upgrades/README.md        | 3 ++-
 leap-upgrades/lib/functions.sh | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/leap-upgrades/README.md b/leap-upgrades/README.md
index e7775da2..e6575b41 100644
--- a/leap-upgrades/README.md
+++ b/leap-upgrades/README.md
@@ -47,7 +47,8 @@ bash ./run-stages.sh
 ```
 
 If you want to pre-load the stages you can do so by running the various scripts
-independently.
+independently. **You must** export ``export UPGRADES_TO_TODOLIST`` once the
+prep.sh script is completed.
 
 ``` bash
 bash ./prep.sh
diff --git a/leap-upgrades/lib/functions.sh b/leap-upgrades/lib/functions.sh
index 4c042c57..7d82ff5c 100644
--- a/leap-upgrades/lib/functions.sh
+++ b/leap-upgrades/lib/functions.sh
@@ -251,6 +251,8 @@ function set_upgrade_vars {
     export CONFIG_DIR="/etc/openstack_deploy"
   ;;
   esac
+  # Do not forget to export the TODOLIST if you run the scripts one by one.
+  warning "export UPGRADES_TO_TODOLIST=\"${UPGRADES_TO_TODOLIST}\""
 }
 
 function pre_flight {