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
89d45d39
Commit
89d45d39
authored
3 years ago
by
Attila Farkas
Browse files
Options
Downloads
Patches
Plain Diff
Fix default output directory
parent
5f9d8257
No related branches found
No related tags found
1 merge request
!32
Version 2.0.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cyber_sandbox_creator/creator.py
+5
-2
5 additions, 2 deletions
cyber_sandbox_creator/creator.py
cyber_sandbox_creator/scripts/create.py
+1
-1
1 addition, 1 deletion
cyber_sandbox_creator/scripts/create.py
with
6 additions
and
3 deletions
cyber_sandbox_creator/creator.py
+
5
−
2
View file @
89d45d39
...
...
@@ -11,7 +11,8 @@ CONFIGURATION_PATH: Path = CSC_PATH / "conf/configuration.yml"
FLAVORS_PATH
:
Path
=
CSC_PATH
/
"
conf/flavors.yml
"
def
create
(
topology
:
Union
[
str
,
Path
],
output_dir
:
Union
[
str
,
Path
],
def
create
(
topology
:
Union
[
str
,
Path
],
output_dir
:
Optional
[
Union
[
str
,
Path
]]
=
None
,
ansible_installed
:
bool
=
False
,
border_router
:
bool
=
False
,
provisioning_dir
:
Optional
[
Union
[
str
,
Path
]]
=
None
,
extra_vars
:
Optional
[
Union
[
str
,
Path
]]
=
None
,
...
...
@@ -43,7 +44,9 @@ def create(topology: Union[str, Path], output_dir: Union[str, Path],
raise
ValueError
(
f
"
Invalid path to topology file
\"
{
topology
}
\"
"
)
try
:
if
isinstance
(
output_dir
,
str
):
if
output_dir
is
None
or
not
output_dir
:
sandbox_path
:
Path
=
topology_path
.
parent
/
"
sandbox
"
elif
isinstance
(
output_dir
,
str
):
sandbox_path
:
Path
=
Path
(
output_dir
).
resolve
()
elif
isinstance
(
output_dir
,
Path
):
sandbox_path
:
Path
=
output_dir
.
resolve
()
...
...
This diff is collapsed.
Click to expand it.
cyber_sandbox_creator/scripts/create.py
+
1
−
1
View file @
89d45d39
...
...
@@ -34,7 +34,7 @@ args = parser.parse_args()
if
args
.
output_dir
:
output_dir
:
str
=
args
.
output_dir
else
:
output_dir
:
str
=
"
sandbox
"
output_dir
:
str
=
""
try
:
creator
.
create
(
args
.
topology_file
,
output_dir
,
args
.
ansible_installed
,
...
...
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