Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
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
TFS
controller
Commits
fa087587
Commit
fa087587
authored
5 months ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Pre-merge code fixes and cleanup
parent
1de28b82
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!294
Release TeraFlowSDN 4.0
,
!285
Resolve: "(CNIT) New SBI Driver based on OpenROADM for ROADMs"
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/opticalcontroller/OpticalController.py
+19
-27
19 additions, 27 deletions
src/opticalcontroller/OpticalController.py
with
19 additions
and
27 deletions
src/opticalcontroller/OpticalController.py
+
19
−
27
View file @
fa087587
...
...
@@ -115,29 +115,26 @@ class AddFlexLightpath(Resource):
@optical.response
(
404
,
'
Error, not found
'
)
class
DelFLightpath
(
Resource
):
@staticmethod
def
delete
(
src
,
dst
,
bitrate
,
o_band_id
,
flow_id
=
None
):
flow
=
None
match1
=
False
ob_id
=
None
def
delete
(
src
,
dst
,
bitrate
,
o_band_id
,
flow_id
=
None
):
flow
=
None
match1
=
False
ob_id
=
None
if
flow_id
is
not
None
:
if
flow_id
in
rsa
.
db_flows
.
keys
():
flow
=
rsa
.
db_flows
[
flow_id
]
match1
=
flow
[
"
src
"
]
==
src
and
flow
[
"
dst
"
]
==
dst
and
flow
[
"
bitrate
"
]
==
bitrate
ob_id
=
flow
[
"
parent_opt_band
"
]
flow
[
'
is_active
'
]
=
False
flow
=
rsa
.
db_flows
[
flow_id
]
match1
=
flow
[
"
src
"
]
==
src
and
flow
[
"
dst
"
]
==
dst
and
flow
[
"
bitrate
"
]
==
bitrate
ob_id
=
flow
[
"
parent_opt_band
"
]
flow
[
'
is_active
'
]
=
False
if
flow
is
not
None
:
bidir
=
flow
[
"
bidir
"
]
if
bidir
:
match2
=
flow
[
"
src
"
]
==
dst
and
flow
[
"
dst
"
]
==
src
and
flow
[
"
bitrate
"
]
==
bitrate
if
match1
or
match2
:
ob_id
=
flow
[
"
parent_opt_band
"
]
rsa
.
del_flow
(
flow
,
ob_id
)
rsa
.
db_flows
[
flow_id
][
"
is_active
"
]
=
False
if
flow_id
in
rsa
.
optical_bands
[
ob_id
][
"
served_lightpaths
"
]
.
remove
:
if
flow_id
in
rsa
.
optical_bands
[
ob_id
][
"
served_lightpaths
"
]:
rsa
.
optical_bands
[
ob_id
][
"
served_lightpaths
"
].
remove
(
flow_id
)
#if rsa.optical_bands[ob_id]["reverse_optical_band_id"] != 0:
# rev_ob_id = rsa.optical_bands[ob_id]["reverse_optical_band_id"]
...
...
@@ -166,34 +163,29 @@ class DelFLightpath(Resource):
return
"
flow id {} does not exist
"
.
format
(
flow_id
),
404
@optical.route
(
'
/DelOpticalBand/<string:src>/<string:dst>/<int:o_band_id>
'
,
methods
=
[
'
DELETE
'
])
@optical.route
(
'
/DelOpticalBand/<string:src>/<string:dst>/<int:o_band_id>
'
,
methods
=
[
'
DELETE
'
])
@optical.response
(
200
,
'
Success
'
)
@optical.response
(
404
,
'
Error, not found
'
)
class
DelOpticalBand
(
Resource
):
@staticmethod
def
delete
(
src
,
dst
,
o_band_id
):
flow
=
None
ob_id
=
None
if
o_band_id
is
not
None
:
ob_id
=
None
if
o_band_id
is
not
None
:
if
o_band_id
in
rsa
.
optical_bands
.
keys
():
flow
=
rsa
.
optical_bands
[
o_band_id
]
#
match1 = flow["src"] == src and flow["dst"] == dst
ob_id
=
o_band_id
flow
=
rsa
.
optical_bands
[
o_band_id
]
match1
=
flow
[
"
src
"
]
==
src
and
flow
[
"
dst
"
]
==
dst
and
flow
[
"
bitrate
"
]
ob_id
=
o_band_id
if
flow
is
not
None
:
bidir
=
flow
[
"
bidir
"
]
if
bidir
:
match2
=
flow
[
"
src
"
]
==
dst
and
flow
[
"
dst
"
]
==
src
and
flow
[
"
bitrate
"
]
match2
=
flow
[
"
src
"
]
==
dst
and
flow
[
"
dst
"
]
==
src
and
flow
[
"
bitrate
"
]
if
match1
or
match2
:
ob_id
=
flow
[
"
parent_opt_band
"
]
#rsa.del_flow(flow, ob_id)
rsa
.
optical_bands
[
ob_id
][
"
is_active
"
]
=
False
# if flow_id in rsa.optical_bands[ob_id]["served_lightpaths"]
.remove
:
# if flow_id in rsa.optical_bands[ob_id]["served_lightpaths"]:
# rsa.optical_bands[ob_id]["served_lightpaths"].remove(flow_id)
#if rsa.optical_bands[ob_id]["reverse_optical_band_id"] != 0:
# rev_ob_id = rsa.optical_bands[ob_id]["reverse_optical_band_id"]
...
...
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