Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert list of strings in master.cfg to multiline strings #164

Merged
merged 1 commit into from Nov 20, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

refactor(master.cfg): convert list of strings to multiline strings

  • Loading branch information
rilut committed Nov 20, 2015
commit 804896ee265ba9d90628ba896f9fc5bcca3b4192
@@ -33,23 +33,23 @@ c['caches'] = {
####### BUILDSLAVES

def make_user_data(s):
lines = []
lines.append("#!/bin/bash")
lines.append("add-apt-repository -y ppa:saltstack/salt")
lines.append("apt-get update")
lines.append("apt-get -y install python-pip salt-minion")
lines.append("echo 96.126.125.232 salt >> /etc/hosts")
lines.append("echo %s > /etc/salt/minion_id" % s)
lines.append("cat <<EOF > /etc/salt/pki/minion/minion.pem")
lines.append(MINION_PRIVATE_KEY.strip())
lines.append("EOF")
lines.append("cat <<EOF > /etc/salt/pki/minion/minion.pub")
lines.append(MINION_PUBLIC_KEY.strip())
lines.append("EOF")
lines.append("service salt-minion restart")
lines.append("sleep 5")
lines.append("salt-call state.highstate")
return "\n".join(lines)
return """\
#!/bin/bash
add-apt-repository -y ppa:saltstack/salt
apt-get update
apt-get -y install python-pip salt-minion
echo 96.126.125.232 salt >> /etc/hosts
echo %(s)s > /etc/salt/minion_id
cat <<EOF > /etc/salt/pki/minion/minion.pem
%(private_key)s
EOF
cat <<EOF > /etc/salt/pki/minion/minion.pub
%(public_key)s
EOF
service salt-minion restart
sleep 5
salt-call state.highstate""" % \
{'private_key': MINION_PRIVATE_KEY.strip(), 'public_key': MINION_PUBLIC_KEY.strip(), 's': s}

c['slaves'] = []
for s in MAC_SLAVES + ANDROID_SLAVES + HEAD_SLAVES + LINUX_LINODE_SLAVES:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.