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
1ff090f8
Commit
1ff090f8
authored
5 years ago
by
Attila Farkas
Browse files
Options
Downloads
Patches
Plain Diff
move border router creation to preprocessing
parent
910f198f
No related branches found
No related tags found
1 merge request
!7
Resolve Refactoring
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
create.py
+8
-2
8 additions, 2 deletions
create.py
modules/preprocessing.py
+17
-0
17 additions, 0 deletions
modules/preprocessing.py
with
25 additions
and
2 deletions
create.py
+
8
−
2
View file @
1ff090f8
...
@@ -8,9 +8,9 @@ import sys
...
@@ -8,9 +8,9 @@ import sys
from
modules.file_generator
import
generate_vagrantfile
,
generate_ansible_files
from
modules.file_generator
import
generate_vagrantfile
,
generate_ansible_files
from
modules.device_creator
import
open_file
from
modules.device_creator
import
open_file
from
modules.routing
import
create_border_router
from
modules.input_argument_parser
import
parse_input_args
from
modules.input_argument_parser
import
parse_input_args
from
modules.input_file_validator
import
validate_device_definitions
from
modules.input_file_validator
import
validate_device_definitions
from
modules.preprocessing
import
preprocess
"""
Parsing the input arguments.
"""
"""
Parsing the input arguments.
"""
...
@@ -36,10 +36,16 @@ except Exception:
...
@@ -36,10 +36,16 @@ except Exception:
print
(
"
Device definition validation was not sussessful.
"
)
print
(
"
Device definition validation was not sussessful.
"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
"""
Preprocessing the definitions before device creation.
"""
try
:
preprocess
(
device_definitions
,
flags
)
except
Exception
:
print
(
"
Preprocessing was not successful.
"
)
sys
.
exit
(
1
)
# TODO
# TODO
create_border_router
(
device_definitions
)
if
"
ansible_local
"
in
flags
and
flags
[
"
ansible_local
"
]:
if
"
ansible_local
"
in
flags
and
flags
[
"
ansible_local
"
]:
generate_vagrantfile
(
device_definitions
,
True
)
generate_vagrantfile
(
device_definitions
,
True
)
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
modules/preprocessing.py
0 → 100644
+
17
−
0
View file @
1ff090f8
"""
This module contains functions for preprocessing. They are supposed to be
called after validating the input but before device creation.
"""
from
modules.routing
import
create_border_router
def
preprocess
(
definitions
,
flags
):
"""
This function handles the preprocessing, operations that need to be done
before the actual device creation.
:param definitions: device definition structure
:param flags: a structure with command line flags
"""
"""
Creating Border router
"""
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