Skip to content
Snippets Groups Projects
Commit c51c52ce authored by Attila Farkas's avatar Attila Farkas
Browse files

remove traceback

parent f68334d2
No related branches found
No related tags found
1 merge request!4Resolve "Add an error message when user provides a non-existing file with sandbox definition as input"
......@@ -7,6 +7,9 @@ import jinja2
from modules.file_generator import generate_vagrantfile, generate_ansible_files
from modules.device_creator import open_file
""" Supressing error traceback. """
sys.tracebacklimit = 0
if len(sys.argv) != 2:
print("Error: Expecting 1 argument (yml file).")
sys.exit()
......@@ -15,4 +18,3 @@ device_definitions = open_file(str(sys.argv[1]))
generate_vagrantfile(device_definitions)
generate_ansible_files(device_definitions)
......@@ -17,7 +17,7 @@ def open_file(file_name):
input_file = open(str(file_name))
return yaml.safe_load(input_file)
except IOError:
print("Error: Cannot find a required file.")
print("Error: Cannot find a required file: " + str(file_name))
def _add_provisioning(hostname, host_definitions):
""" Adds provisioning to the device if the file exists. """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment