People can leave their devstack installs around for a long time, and
in the mean time new versions of pip can be released.
The current check does not download a new version if an old one
exists. We want to check for new versions, but we also don't want the
gate jobs trying this sometimes unreliable fetch.
So add a flag-file that tells devstack if it downloaded get-pip.py
originally. If so, on each run check for a new version using curl's
"-z" flag to request only files modified since the file's timestamp.
Change-Id: I91734528f02deafabf3d18d968c3abd749751199
Closes-Bug: #1429943
| ... | ... |
@@ -42,9 +42,21 @@ function get_versions {
|
| 42 | 42 |
|
| 43 | 43 |
|
| 44 | 44 |
function install_get_pip {
|
| 45 |
- if [[ ! -r $LOCAL_PIP ]]; then |
|
| 46 |
- curl --retry 6 --retry-delay 5 -o $LOCAL_PIP $PIP_GET_PIP_URL || \ |
|
| 45 |
+ # the openstack gate and others put a cached version of get-pip.py |
|
| 46 |
+ # for this to find, explicitly to avoid download issues. |
|
| 47 |
+ # |
|
| 48 |
+ # However, if devstack *did* download the file, we want to check |
|
| 49 |
+ # for updates; people can leave thier stacks around for a long |
|
| 50 |
+ # time and in the mean-time pip might get upgraded. |
|
| 51 |
+ # |
|
| 52 |
+ # Thus we use curl's "-z" feature to always check the modified |
|
| 53 |
+ # since and only download if a new version is out -- but only if |
|
| 54 |
+ # it seems we downloaded the file originally. |
|
| 55 |
+ if [[ ! -r $LOCAL_PIP || -r $LOCAL_PIP.downloaded ]]; then |
|
| 56 |
+ curl --retry 6 --retry-delay 5 \ |
|
| 57 |
+ -z $LOCAL_PIP -o $LOCAL_PIP $PIP_GET_PIP_URL || \ |
|
| 47 | 58 |
die $LINENO "Download of get-pip.py failed" |
| 59 |
+ touch $LOCAL_PIP.downloaded |
|
| 48 | 60 |
fi |
| 49 | 61 |
sudo -H -E python $LOCAL_PIP |
| 50 | 62 |
} |