Use "OS_INSECURE" variable as the insecure mode indicator 83/36783/2
authorJingLu5 <lvjing5@huawei.com>
Fri, 30 Jun 2017 06:27:23 +0000 (06:27 +0000)
committerJing Lu <lvjing5@huawei.com>
Fri, 30 Jun 2017 06:40:20 +0000 (06:40 +0000)
Now we use "OS_CACERT" as the insecure mode indicator, it is better to use "OS_INSECURE".

Change-Id: I1406193e27510390b4b8fd8f4751d8361560172f
Signed-off-by: JingLu5 <lvjing5@huawei.com>
tests/ci/clean_images.sh
tests/ci/load_images.sh
yardstick/benchmark/scenarios/availability/ha_tools/nova/create_flavor.bash
yardstick/benchmark/scenarios/availability/ha_tools/nova/delete_flavor.bash
yardstick/benchmark/scenarios/availability/ha_tools/nova/show_flavors.bash
yardstick/benchmark/scenarios/availability/monitor/monitor_command.py
yardstick/common/openstack_utils.py

index f250064..b3363cb 100755 (executable)
@@ -15,7 +15,7 @@ cleanup()
     echo
     echo "========== Cleanup =========="
 
-    if [ $OS_CACERT ] && [ "$(echo $OS_CACERT | tr '[:upper:]' '[:lower:]')" = "false" ]; then
+    if [ $OS_INSECURE ] && [ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]; then
         SECURE="--insecure"
     else
         SECURE=""
index 0c197b3..29d73dc 100755 (executable)
@@ -250,7 +250,7 @@ main()
         RAW_IMAGE='/home/opnfv/images/yardstick-image.tar.gz'
     fi
 
-    if [ $OS_CACERT ] && [ "$(echo $OS_CACERT | tr '[:upper:]' '[:lower:]')" = "false" ]; then
+    if [ $OS_INSECURE ] && [ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]; then
         SECURE="--insecure"
     else
         SECURE=""
index 8737836..aee516e 100644 (file)
@@ -14,7 +14,7 @@
 
 set -e
 
-if [ $OS_CACERT ] && [ "$(echo $OS_CACERT | tr '[:upper:]' '[:lower:]')" = "false" ]; then
+if [ $OS_INSECURE ] && [ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]; then
     SECURE="--insecure"
 else
     SECURE=""
index 617dcf8..d39926f 100644 (file)
@@ -14,7 +14,7 @@
 
 set -e
 
-if [ $OS_CACERT ] && [ "$(echo $OS_CACERT | tr '[:upper:]' '[:lower:]')" = "false" ]; then
+if [ $OS_INSECURE ] && [ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]; then
     SECURE="--insecure"
 else
     SECURE=""
index 9b413c9..bd61ba9 100644 (file)
@@ -13,7 +13,7 @@
 
 set -e
 
-if [ $OS_CACERT ] && [ "$(echo $OS_CACERT | tr '[:upper:]' '[:lower:]')" = "false" ]; then
+if [ $OS_INSECURE ] && [ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]; then
     SECURE="--insecure"
 else
     SECURE=""
index d757bd8..a0777f9 100644 (file)
@@ -56,11 +56,11 @@ class MonitorOpenstackCmd(basemonitor.BaseMonitor):
         self.cmd = self._config["command_name"]
 
         try:
-            cacert = os.environ['OS_CACERT']
+            insecure = os.environ['OS_INSECURE']
         except KeyError:
             pass
         else:
-            if cacert.lower() == "false":
+            if insecure.lower() == "true":
                 self.cmd = self.cmd + " --insecure"
 
     def monitor_func(self):
index 1f08344..8787e60 100644 (file)
@@ -79,7 +79,8 @@ def get_session():
     except KeyError:
         return session.Session(auth=auth)
     else:
-        cacert = False if cacert.lower() == "false" else cacert
+        insecure = os.getenv('OS_INSECURE', '').lower() == 'true'
+        cacert = False if insecure else cacert
         return session.Session(auth=auth, verify=cacert)