link type emulator to ourself

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-16 15:29:56 +02:00
parent 40d494ace2
commit 1b0d85dcbe

View file

@ -367,7 +367,7 @@ class Cdist:
def link_type_to_emulator(self): def link_type_to_emulator(self):
"""Link type names to cdist-type-emulator""" """Link type names to cdist-type-emulator"""
for type in self.list_types(): for type in self.list_types():
source = os.path.join(self.lib_dir, "cdist-type-emulator") source = sys.argv[0]
destination = os.path.join(self.bin_dir, type) destination = os.path.join(self.bin_dir, type)
log.debug("Linking %s to %s", source, destination) log.debug("Linking %s to %s", source, destination)
os.symlink(source, destination) os.symlink(source, destination)
@ -637,6 +637,18 @@ def emulator():
"""Emulate type commands (i.e. __file and co)""" """Emulate type commands (i.e. __file and co)"""
type = os.path.basename(sys.argv[0]) type = os.path.basename(sys.argv[0])
parser = argparse.ArgumentParser(add_help=False)
print("Oh, noe")
sys.exit(1)
# Setup optional parameters
# Setup required parameters
# Setup positional parameter, if not singleton
def commandline(): def commandline():
"""Parse command line""" """Parse command line"""
# Construct parser others can reuse # Construct parser others can reuse