diff options
Diffstat (limited to 'lib/python/apex/common/utils.py')
-rw-r--r-- | lib/python/apex/common/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/python/apex/common/utils.py b/lib/python/apex/common/utils.py index d623638c..8e6896fa 100644 --- a/lib/python/apex/common/utils.py +++ b/lib/python/apex/common/utils.py @@ -21,3 +21,11 @@ def parse_yaml(yaml_file): with open(yaml_file) as f: parsed_dict = yaml.safe_load(f) return parsed_dict + + +def write_str(bash_str, path=None): + if path: + with open(path, 'w') as file: + file.write(bash_str) + else: + print(bash_str) |