15 def check_execute(cmd, terminate_on_error=True):
17 Executes a shell commands and check for =! 0 return codes
20 print(f
"Executing command '{cmd}'")
22 print(f
"Command '{cmd}' exited with code {res}")
24 print(
"FATAL: Exit code is not 0")
25 if terminate_on_error:
32 def check_path_exists(paths, terminate_on_error=True):
34 Checks if a path exists.
36 @param paths: list of file system path (directories or files)
37 @param terminate_on_error: if true, the execution is terminated if one part
43 print(f
"Checking for existance of file {p}")
44 if not os.path.exists(p):
45 print(f
"Path {p} does not exist")
46 if terminate_on_error:
51 def create_fake_scripts(folders, scriptname):
53 Creates a fake script inside a nested path
54 :param folders: folders to hold the script
55 :param scriptname: name of the script itself
58 if not os.path.exists(folders):
60 with open(os.path.join(folders, scriptname),
"w")
as f:
61 f.write(
"# not content on purpose")