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
829ea636
Commit
829ea636
authored
4 years ago
by
Attila Farkas
Browse files
Options
Downloads
Patches
Plain Diff
delete dummy-router if present
parent
b05d0db4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
Resolve "43-add-compatibility-with-kypo-topo-library-using-dummy-router"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/preprocessing.py
+15
-0
15 additions, 0 deletions
modules/preprocessing.py
with
15 additions
and
0 deletions
modules/preprocessing.py
+
15
−
0
View file @
829ea636
...
@@ -11,6 +11,7 @@ from modules.file_manager import open_yaml, cleanup_and_exit
...
@@ -11,6 +11,7 @@ from modules.file_manager import open_yaml, cleanup_and_exit
FLAVORS
=
open_yaml
(
"
conf/flavors.yml
"
)
FLAVORS
=
open_yaml
(
"
conf/flavors.yml
"
)
ROUTER_ATTRIBUTES
=
open_yaml
(
"
conf/router_attributes.yml
"
)
ROUTER_ATTRIBUTES
=
open_yaml
(
"
conf/router_attributes.yml
"
)
DUMMY_ROUTER_NAME
=
"
dummy-router
"
def
_add_missing_tags
(
definitions
):
def
_add_missing_tags
(
definitions
):
...
@@ -62,6 +63,14 @@ def _add_flavors(definitions):
...
@@ -62,6 +63,14 @@ def _add_flavors(definitions):
host
.
pop
(
"
flavor
"
)
host
.
pop
(
"
flavor
"
)
def
_delete_dummy_router
(
definitions
):
"""
Delete dummy router if it is defined.
"""
for
router
in
definitions
[
"
routers
"
]:
if
router
[
"
name
"
]
==
DUMMY_ROUTER_NAME
:
definitions
[
"
routers
"
].
remove
(
router
)
return
def
preprocess
(
definitions
,
flags
):
def
preprocess
(
definitions
,
flags
):
"""
Run preprocessing.
"""
Run preprocessing.
...
@@ -75,6 +84,12 @@ def preprocess(definitions, flags):
...
@@ -75,6 +84,12 @@ def preprocess(definitions, flags):
cleanup_and_exit
(
"
Preprocessing not successful:
"
cleanup_and_exit
(
"
Preprocessing not successful:
"
"
Could not add missing tags.
"
)
"
Could not add missing tags.
"
)
try
:
_delete_dummy_router
(
definitions
)
except
Exception
:
cleanup_and_exit
(
"
Preprocessing not successful:
"
"
Could not delete dummy router.
"
)
try
:
try
:
if
"
border_router
"
in
flags
and
flags
[
"
border_router
"
]:
if
"
border_router
"
in
flags
and
flags
[
"
border_router
"
]:
create_border_router
(
definitions
)
create_border_router
(
definitions
)
...
...
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