From 2f85b02ffa223ceae20c31de71138d6ad1bd7fcd Mon Sep 17 00:00:00 2001 From: Benjamin Zaitlen Date: Fri, 3 Feb 2017 14:46:34 -0500 Subject: [PATCH] upgrade pip and new pip deps --- dask_ec2/salt.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dask_ec2/salt.py b/dask_ec2/salt.py index 9c325e0..549e08f 100644 --- a/dask_ec2/salt.py +++ b/dask_ec2/salt.py @@ -162,6 +162,20 @@ def __install_python_pip(): raise DaskEc2Exception("%s\nCouldn't install python-pip. Error is above (maybe try again)" % e.last_exception) + @retry(retries=3, wait=0) + def __upgrade_pip(): + cmd = "pip install --upgrade pip packaging appdirs six" + ret = master.exec_command(cmd, sudo=True) + if ret["exit_code"] != 0: + raise Exception(ret["stderr"]) + + try: + __upgrade_pip() + except RetriesExceededException as e: + raise DaskEc2Exception( + "%s\nCouldn't upgrade pip. Error is above (maybe try again)" % + e.last_exception) + @retry(retries=3, wait=0) def __install_salt_rest_api(): cmd = "pip install cherrypy"