move emulator link to emulator module and make source variable (exec_path)

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-27 13:38:25 +02:00
commit 6f1a13b531
3 changed files with 26 additions and 108 deletions

View file

@ -133,3 +133,12 @@ def emulator(argv):
# sys.exit(1)
print("Finished " + type + "/" + object_id + repr(params))
def link(exec_path, bin_dir, type_list):
"""Link type names to cdist-type-emulator"""
source = os.path.abspath(exec_path)
for type in type_list:
destination = os.path.join(bin_dir, type)
log.debug("Linking %s to %s", source, destination)
os.symlink(source, destination)