From 91977e7c8f9eef9b4fedf4c9ecf27442c5014b88 Mon Sep 17 00:00:00 2001 From: Ghe Rivero Date: Tue, 18 Nov 2014 15:50:39 +0100 Subject: [PATCH] Warning when using pypi element without a mirror Using only a local filesystem mirror could lead opaque errors. Print a warning message in this situations. Change-Id: I5f77151ea928868f4c441e8a1bb2eb0966b21832 Closes-Bug: #1297948 --- elements/pypi/pre-install.d/00-configure-pypi-mirror | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elements/pypi/pre-install.d/00-configure-pypi-mirror b/elements/pypi/pre-install.d/00-configure-pypi-mirror index a184f995d..1a217b7cb 100755 --- a/elements/pypi/pre-install.d/00-configure-pypi-mirror +++ b/elements/pypi/pre-install.d/00-configure-pypi-mirror @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +from __future__ import print_function + import os.path @@ -24,6 +26,8 @@ def main(): indices = list(map(os.environ.get, sorted(candidates))) else: indices = ['file:///tmp/pypi'] + print('WARNING: You are using the pypi element but no pypi mirror is ' + 'defined via the PYPI_MIRROR_URL env variable') easy_index = indices[-1] use_pypi_python_org = True if os.environ.get('DIB_OFFLINE'):