Browse code

Run pip check at end of devstack

The new pip depsolver is coming this summer. Until it's ready,
run pip check at the end of devstack to make sure we're not
somehow installing conflicting package versions. We shouldn't
be, because of constraints, but if we are, better to know and
start figuring it out.

Change-Id: Id98f0848ff5a252d93e5f8029df2d069924d603f

Monty Taylor authored on 2020/03/25 22:32:26
Showing 2 changed files
... ...
@@ -111,6 +111,30 @@ function disable_python3_package {
111 111
     $xtrace
112 112
 }
113 113
 
114
+
115
+function pip_check {
116
+    time_start "pip_check"
117
+
118
+    if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then
119
+        local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip
120
+    else
121
+        local cmd_pip
122
+        if python3_enabled; then
123
+            echo "Using python $PYTHON3_VERSION to check pip install because python3_enabled=True"
124
+            cmd_pip=$(get_pip_command $PYTHON3_VERSION)
125
+        else
126
+            echo "Using python $PYTHON2_VERSION to check pip install because python3_enabled=False"
127
+            cmd_pip=$(get_pip_command $PYTHON2_VERSION)
128
+        fi
129
+    fi
130
+
131
+    $cmd_pip check
132
+    result=$?
133
+
134
+    time_stop "pip_check"
135
+    return $result
136
+}
137
+
114 138
 # Wrapper for ``pip install`` to set cache and proxy environment variables
115 139
 # Uses globals ``OFFLINE``, ``PIP_VIRTUAL_ENV``,
116 140
 # ``PIP_UPGRADE``, ``*_proxy``,
... ...
@@ -1421,6 +1421,9 @@ fi
1421 1421
 # Check the status of running services
1422 1422
 service_check
1423 1423
 
1424
+# Run pip check to make sure we're forward compatible with the pip depsolver.
1425
+pip_check
1426
+
1424 1427
 # Configure nova cellsv2
1425 1428
 # ----------------------
1426 1429