salt/bin/prepare_mock.py

15 lines
348 B
Python
Raw Normal View History

#!/usr/bin/env python3
import os
import shutil
import socket
iddir = 'pillar/id/'
secretiddir = 'pillar/secret/id/'
baseidfile = 'pillar/mock/example.sls'
myidfile = socket.gethostname() + '.sls'
shutil.copyfile(baseidfile, os.path.join(iddir, myidfile))
os.makedirs(secretiddir)
shutil.copyfile(baseidfile, os.path.join(secretiddir, myidfile))