Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
combine all apt-calls
Browse files Browse the repository at this point in the history
  • Loading branch information
quasiben committed Feb 10, 2017
1 parent ecc0043 commit 765fdcb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dask_ec2/salt.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ def __setup_salt_master():
e.last_exception)

@retry(retries=3, wait=0)
def __install_python_pip():
cmd = "apt-get install -y python-pip"
def __apt_installs():
cmd = "apt-get install -y python-pip libssl-dev libffi-dev python-dev"
ret = master.exec_command(cmd, sudo=True)
if ret["exit_code"] != 0:
raise Exception(ret["stderr"].decode('utf-8'))

try:
__install_python_pip()
__apt_installs()
except RetriesExceededException as e:
raise DaskEc2Exception("%s\nCouldn't install python-pip. Error is above (maybe try again)" %
raise DaskEc2Exception("%s\nCouldn't install ubuntu dependencies. Error is above (maybe try again)" %
e.last_exception)

@retry(retries=3, wait=0)
Expand Down Expand Up @@ -191,7 +191,7 @@ def __install_salt_rest_api():

@retry(retries=3, wait=0)
def __install_pyopensll():
cmd = "apt-get install libssl-dev libffi-dev python-dev -y; pip install PyOpenSSL==16.2.0"
cmd = "pip install PyOpenSSL==16.2.0"
ret = master.exec_command(cmd, sudo=True)
if ret["exit_code"] != 0:
raise Exception(ret["stderr"])
Expand Down

0 comments on commit 765fdcb

Please sign in to comment.