Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
7671453a
Commit
7671453a
authored
1 year ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
Revert "added template site param handling"
This reverts commit
0f5b13ca
.
parent
c6eea066
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/services/resource_manager.py
+9
-27
9 additions, 27 deletions
gso/services/resource_manager.py
with
9 additions
and
27 deletions
gso/services/resource_manager.py
+
9
−
27
View file @
7671453a
# mypy: ignore-errors
from
enum
import
Enum
,
auto
from
typing
import
List
,
Set
from
typing
import
List
from
gso
import
settings
...
...
@@ -16,45 +16,27 @@ class InterfaceAllocationState(Enum):
ALLOCATED
=
auto
()
def
_dummy_router_interfaces
(
site_name
)
->
dict
:
def
_dummy_router_interfaces
(
)
:
return
{
"
site
"
:
site_name
,
"
lags
"
:
[],
"
physical
"
:
[{
"
name
"
:
f
"
ifc-
{
x
}
"
,
"
state
"
:
InterfaceAllocationState
.
AVAILABLE
}
for
x
in
range
(
250
)],
}
_DUMMY_SITES
=
{
"
site-a
"
,
"
site-b
"
,
"
site-c
"
}
_DUMMY_INVENTORY
=
{
"
fqdn-a
"
:
_dummy_router_interfaces
(
"
site-a
"
),
"
fqdn-b
"
:
_dummy_router_interfaces
(
"
site-a
"
),
"
fqdn-c
"
:
_dummy_router_interfaces
(
"
site-b
"
),
"
fqdn-d
"
:
_dummy_router_interfaces
(
"
site-b
"
),
"
fqdn-e
"
:
_dummy_router_interfaces
(
"
site-c
"
),
"
fqdn-f
"
:
_dummy_router_interfaces
(
"
site-c
"
)
"
fqdn-a
"
:
_dummy_router_interfaces
(),
"
fqdn-b
"
:
_dummy_router_interfaces
(),
"
fqdn-c
"
:
_dummy_router_interfaces
(),
"
fqdn-d
"
:
_dummy_router_interfaces
(),
}
def
import_new_site
(
new_site_name
:
str
,
oss_params
=
settings
.
OSSParams
):
# TODO: this is a dummy implementation
assert
new_site_name
not
in
_DUMMY_SITES
_DUMMY_SITES
.
add
(
new_site_name
)
def
import_new_router
(
new_router_fqdn
:
str
,
site_name
:
str
,
oss_params
=
settings
.
OSSParams
):
def
import_new_router
(
new_router_fqdn
:
str
,
oss_params
=
settings
.
OSSParams
):
# TODO: this is a dummy implementation
# TODO: specify if this should be an error (and if not, what it means)
assert
site_name
in
_DUMMY_SITES
# TODO: specifiy if this should be an error (and if now, what it means)
assert
new_router_fqdn
not
in
_DUMMY_INVENTORY
_DUMMY_INVENTORY
[
new_router_fqdn
]
=
_dummy_router_interfaces
(
site_name
)
_DUMMY_INVENTORY
[
new_router_fqdn
]
=
_dummy_router_interfaces
()
def
next_lag
(
router_fqdn
:
str
,
oss_params
=
settings
.
OSSParams
)
->
str
:
...
...
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