use python3

This commit is contained in:
Fredrik Thulin 2019-01-15 13:18:22 +01:00
parent fc3d3294ed
commit f25a6af712
No known key found for this signature in database
GPG key ID: 2707330D4030CCAD
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys import sys
import yaml import yaml
@ -14,5 +14,5 @@ if os.path.exists(db_file):
with open(db_file) as fd: with open(db_file) as fd:
db.update(yaml.load(fd)) db.update(yaml.load(fd))
print yaml.dump(dict(classes=db['classes'].get(node_name,dict()),parameters=dict(roles=db.get('members',[])))) print(yaml.dump(dict(classes=db['classes'].get(node_name,dict()),parameters=dict(roles=db.get('members',[])))))

View file

@ -6,7 +6,8 @@ CACHE_DIR=/var/cache/puppet-modules
MODULES_DIR=${MODULES_DIR:=/etc/puppet/cosmos-modules} MODULES_DIR=${MODULES_DIR:=/etc/puppet/cosmos-modules}
export GNUPGHOME=/etc/cosmos/gnupg export GNUPGHOME=/etc/cosmos/gnupg
python -c "import yaml" 2>/dev/null || apt-get -y install python-yaml # /etc/puppet/cosmos_enc.py needs the YAML module
python3 -c "import yaml" 2>/dev/null || apt-get -y install python3-yaml
bold='\e[1m' bold='\e[1m'
reset='\e[0m' reset='\e[0m'