From 572401e4f8010574df45423ccb1c21f056b719b9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 8 Sep 2011 03:56:59 +0200 Subject: [PATCH] commit broken stuff Signed-off-by: Nico Schottelius --- bin/cdist | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/bin/cdist b/bin/cdist index 59d99040..e1d62391 100755 --- a/bin/cdist +++ b/bin/cdist @@ -22,8 +22,22 @@ import sys # argv import subprocess # execute stuff import os +import tempfile +import shutil -__cdist_version="2.0.0" + +class Cdist: + """Cdist main class to hold arbitrary data""" + version="2.0.0" + + def __init__(self): + self.tempdir = tempfile.mkdtemp() + print(self.tempdir) + + def __del__(self): + print("Zerstoeren") + print(self.tempdir) + shutil.rmtree(self.tempdir) def logger(type, *args): """Ignore type for now, support later""" @@ -76,7 +90,7 @@ def remote_conf_directory(): return os.path.join(remote_base_directory(), "conf") def out_dir(): - FIXME: stopped - probably need static temp know! + # FIXME: stopped - probably need static temp know! """Local directory containing output""" return os.path.join(base_directory(), "conf") @@ -134,7 +148,9 @@ def cdist_deploy_to(hostname): if __name__ == "__main__": hostname=sys.argv[1] - logger("info", "cdist", __cdist_version, ": Configuring host", hostname) +# logger("info", "cdist", cdist_version, ": Configuring host", hostname) cdist_deploy_to(hostname) print(list_global_explorers()) + c = Cdist() +