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
7a84ea8d
Commit
7a84ea8d
authored
3 years ago
by
Roberto Rubino
Browse files
Options
Downloads
Patches
Plain Diff
double checked name of variable __ietf_root
parent
71966646
No related branches found
No related tags found
1 merge request
!54
Release 2.0.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/device/service/drivers/microwave/IETFApiDriver.py
+7
-7
7 additions, 7 deletions
src/device/service/drivers/microwave/IETFApiDriver.py
with
7 additions
and
7 deletions
src/device/service/drivers/microwave/IETFApiDriver.py
+
7
−
7
View file @
7a84ea8d
...
...
@@ -26,20 +26,20 @@ class IETFApiDriver(_Driver):
self
.
__lock
=
threading
.
Lock
()
self
.
__started
=
threading
.
Event
()
self
.
__terminate
=
threading
.
Event
()
self
.
__
tapi
_root
=
'
https://
'
+
address
+
'
:
'
+
str
(
port
)
self
.
__
ietf
_root
=
'
https://
'
+
address
+
'
:
'
+
str
(
port
)
self
.
__timeout
=
int
(
settings
.
get
(
'
timeout
'
,
120
))
def
Connect
(
self
)
->
bool
:
url
=
self
.
__
tapi
_root
+
'
/nmswebs/restconf/data/ietf-network:networks
'
url
=
self
.
__
ietf
_root
+
'
/nmswebs/restconf/data/ietf-network:networks
'
with
self
.
__lock
:
if
self
.
__started
.
is_set
():
return
True
try
:
requests
.
get
(
url
,
timeout
=
self
.
__timeout
,
verify
=
False
)
except
requests
.
exceptions
.
Timeout
:
LOGGER
.
exception
(
'
Timeout connecting {:s}
'
.
format
(
str
(
self
.
__
tapi
_root
)))
LOGGER
.
exception
(
'
Timeout connecting {:s}
'
.
format
(
str
(
self
.
__
ietf
_root
)))
return
False
except
Exception
:
# pylint: disable=broad-except
LOGGER
.
exception
(
'
Exception connecting {:s}
'
.
format
(
str
(
self
.
__
tapi
_root
)))
LOGGER
.
exception
(
'
Exception connecting {:s}
'
.
format
(
str
(
self
.
__
ietf
_root
)))
return
False
else
:
self
.
__started
.
set
()
...
...
@@ -62,7 +62,7 @@ class IETFApiDriver(_Driver):
for
i
,
resource_key
in
enumerate
(
resource_keys
):
str_resource_name
=
'
resource_key[#{:d}]
'
.
format
(
i
)
chk_string
(
str_resource_name
,
resource_key
,
allow_empty
=
False
)
results
.
extend
(
config_getter
(
self
.
__
tapi
_root
,
resource_key
,
self
.
__timeout
))
results
.
extend
(
config_getter
(
self
.
__
ietf
_root
,
resource_key
,
self
.
__timeout
))
return
results
...
...
@@ -82,7 +82,7 @@ class IETFApiDriver(_Driver):
uuid
=
find_key
(
resource
,
'
uuid
'
)
data
=
create_connectivity_service
(
self
.
__
tapi
_root
,
self
.
__timeout
,
uuid
,
node_id_src
,
tp_id_src
,
node_id_dst
,
tp_id_dst
,
vlan_id
)
self
.
__
ietf
_root
,
self
.
__timeout
,
uuid
,
node_id_src
,
tp_id_src
,
node_id_dst
,
tp_id_dst
,
vlan_id
)
results
.
extend
(
data
)
return
results
...
...
@@ -94,7 +94,7 @@ class IETFApiDriver(_Driver):
for
resource
in
resources
:
LOGGER
.
info
(
'
resource = {:s}
'
.
format
(
str
(
resource
)))
uuid
=
find_key
(
resource
,
'
uuid
'
)
results
.
extend
(
delete_connectivity_service
(
self
.
__
tapi
_root
,
self
.
__timeout
,
uuid
))
results
.
extend
(
delete_connectivity_service
(
self
.
__
ietf
_root
,
self
.
__timeout
,
uuid
))
return
results
def
SubscribeState
(
self
,
subscriptions
:
List
[
Tuple
[
str
,
float
,
float
]])
->
List
[
Union
[
bool
,
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