Commit ca01e50e authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Add function for creating temp directory

parent fe584cc4
......@@ -160,7 +160,7 @@ def main():
# Clone the repo
repo_dir = options.repo_dir
if not repo_dir:
repo_dir = mktemp("-d", "/tmp/devflow-build-repo-XXX").stdout.strip()
repo_dir = create_temp_directory("df-repo")
print_green("Created temporary directory '%s' for the cloned repo."
% repo_dir)
......@@ -256,7 +256,7 @@ def main():
# Create debian branches
build_dir = options.build_dir
if not options.build_dir:
build_dir = mktemp("-d", "/tmp/devflow-build-XXX").stdout.strip()
build_dir = create_temp_directory("df-build")
print_green("Created directory '%s' to store the .deb files." %
build_dir)
......@@ -307,5 +307,10 @@ def get_packages_to_build(config_file):
return l
def create_temp_directory(suffix):
create_dir_cmd = mktemp("-d", "/tmp/" + suffix + "-XXXXX")
return create_dir_cmd.stdout.strip()
if __name__ == "__main__":
sys.exit(main())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment