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
bba5913f
Commit
bba5913f
authored
4 years ago
by
Attila Farkas
Browse files
Options
Downloads
Patches
Plain Diff
Adjust vagrant arguments of windows hosts
parent
64f6da68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!22
Resolve "Support Windows boxes"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/preprocessing.py
+17
-2
17 additions, 2 deletions
modules/preprocessing.py
with
17 additions
and
2 deletions
modules/preprocessing.py
+
17
−
2
View file @
bba5913f
...
...
@@ -45,7 +45,7 @@ def _add_extra_arguments(definitions, flags):
if
"
border_router
"
in
flags
and
flags
[
"
ansible_local
"
]:
for
device
in
itertools
.
chain
(
definitions
[
"
hosts
"
],
definitions
[
"
routers
"
]):
if
"
synced_folder
"
not
in
device
:
if
"
synced_folder
"
not
in
device
and
"
communicator
"
not
in
device
:
device
[
"
synced_folder
"
]
=
"
\"
.
\"
,
\"
/vagrant
\"
, type:
\"
rsync
"
\
"
\"
, rsync__exclude:
\"
.git/
\"
"
...
...
@@ -81,6 +81,12 @@ def _find_windows_boxes(definitions):
return
windows_hosts
def
_add_windows_attributes
(
host
):
"""
Add vagrant attributes to windows hosts
"""
host
[
"
communicator
"
]
=
"
winrm
"
host
[
"
winrm_username
"
]
=
"
vagrant
"
def
preprocess
(
definitions
,
flags
):
"""
Run preprocessing.
...
...
@@ -107,13 +113,22 @@ def preprocess(definitions, flags):
cleanup_and_exit
(
"
Preprocessing not successful:
"
"
Could not create border router (
"
+
error
+
"
)
"
)
windows_hosts
=
_find_windows_boxes
(
definitions
)
try
:
if
_find_
windows_
boxes
(
definitions
)
:
if
windows_
hosts
:
create_controller
(
definitions
)
except
(
ValueError
,
IndexError
)
as
error
:
cleanup_and_exit
(
"
Preprocessing not successful:
"
"
Could not create controller (
"
+
error
+
"
)
"
)
try
:
for
host
in
definitions
[
"
hosts
"
]:
if
host
[
"
name
"
]
in
windows_hosts
:
_add_windows_attributes
(
host
)
except
(
ValueError
,
IndexError
)
as
error
:
cleanup_and_exit
(
"
Preprocessing not successful:
"
"
Could not create controller (
"
+
error
+
"
)
"
)
try
:
_configure_routers
(
definitions
)
except
Exception
:
...
...
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