Skip to content

Instantly share code, notes, and snippets.

@href
Created May 25, 2018 08:15
Show Gist options
  • Save href/efa404837f392d6b84f0b36b59b605a2 to your computer and use it in GitHub Desktop.
Save href/efa404837f392d6b84f0b36b59b605a2 to your computer and use it in GitHub Desktop.
Installs Suitable with Mitogen using Python 2.7 for Testing
#!/usr/bin/env bash
path="$1"
set -eu
if [ -z "$path" ]; then
echo "Please pass an install directory"
exit 1
fi
if [ -d "$path" ]; then
echo "The install directory may not exist"
exit 1
fi
mkdir "$path"
cd "$path"
virtualenv -p python2.7 .
bin/pip install git+https://github.com/seantis/suitable#egg=suitable
curl -O -L https://github.com/dw/mitogen/archive/master.tar.gz
tar xzvf master.tar.gz --strip-components=1
bin/pip install -e .
cat <<EOF > test.py
from suitable import Api, install_strategy_plugins
install_strategy_plugins('./ansible_mitogen/plugins/strategy')
api = Api('localhost', strategy='mitogen_linear')
print api.command('whoami')
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment