Skip to content

Instantly share code, notes, and snippets.

Created September 4, 2015 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3604ecef12c50c8bd685 to your computer and use it in GitHub Desktop.
Save anonymous/3604ecef12c50c8bd685 to your computer and use it in GitHub Desktop.
{% set current_path = salt['environ.get']('PATH', '/bin:/usr/bin') %}
{% set mdp_env_var = salt['custmod.mdp_ver']() %}
install_tats:
cmd.run:
- name: "./install_tats -c -u -j10 -n -f"
- cwd: /home/tatsbuild/core/trunk
- shell: /bin/bash
- env:
- PATH: {{ ['/usr/local/gcc/bin:/usr/local/bin', current_path]|join(':') }}
- MDP_VERSION: {{ mdp_env_var }}
@mrwboilers
Copy link

!/usr/bin/python

import subprocess, shlex

def test():
return True

def mdp_ver():
grpcmd = shlex.split("grep MDP_VERSION /etc/bashrc")
line = subprocess.Popen(grpcmd, stdout=subprocess.PIPE)
VERSION = subprocess.Popen(shlex.split("tail -c 9"), stdin=line.stdout, stdout=subprocess.PIPE)
return VERSION.communicate()[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment