Skip to content

Commit

Permalink
Provisioning example: Remove HTTP proxy boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
carletes committed Aug 11, 2014
1 parent b013837 commit 9d57d0b
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions samples/provision-node.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,15 @@
cls = get_driver(VAGRANT)
driver = cls()

environ = dict(os.environ)
for k in ("http_proxy", "https_proxy", "no_proxy"):
environ[k] = os.environ.get(k, "")

provision_script = ScriptDeployment("""#!/bin/sh
exec 2>&1
set -ex
sudo_run() {
sudo env \
http_proxy="%(http_proxy)s" \
https_proxy="%(https_proxy)s" \
no_proxy="%(no_proxy)s"\
$*
}
sudo_run apt-get -y update
sudo_run apt-get -y install puppet
""" % environ)
sudo apt-get -y update
sudo apt-get -y install puppet
""")


LOG = logging.getLogger(os.path.basename(__file__))
Expand Down

0 comments on commit 9d57d0b

Please sign in to comment.