Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cyber-sandbox-creator
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUNI-KYPO-CSC
cyber-sandbox-creator
Commits
c51c52ce
Commit
c51c52ce
authored
5 years ago
by
Attila Farkas
Browse files
Options
Downloads
Patches
Plain Diff
remove traceback
parent
f68334d2
No related branches found
No related tags found
1 merge request
!4
Resolve "Add an error message when user provides a non-existing file with sandbox definition as input"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
create.py
+3
-1
3 additions, 1 deletion
create.py
modules/device_creator.py
+1
-1
1 addition, 1 deletion
modules/device_creator.py
with
4 additions
and
2 deletions
create.py
+
3
−
1
View file @
c51c52ce
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
modules/device_creator.py
+
1
−
1
View file @
c51c52ce
...
...
@@ -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.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment