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
641ddae8
Commit
641ddae8
authored
2 years ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Device component:
- removed log messages for testing purposes
parent
9fa1fc44
No related branches found
No related tags found
2 merge requests
!54
Release 2.0.0
,
!34
Context Scalability extensions using CockroachDB + Removal of Stateful database inside Device + other
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/device/service/Tools.py
+1
-11
1 addition, 11 deletions
src/device/service/Tools.py
src/device/service/driver_api/DriverInstanceCache.py
+1
-1
1 addition, 1 deletion
src/device/service/driver_api/DriverInstanceCache.py
with
2 additions
and
12 deletions
src/device/service/Tools.py
+
1
−
11
View file @
641ddae8
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
json
,
logging
import
json
from
typing
import
Any
,
Dict
,
List
,
Tuple
,
Union
from
common.Constants
import
DEFAULT_CONTEXT_NAME
,
DEFAULT_TOPOLOGY_NAME
from
common.method_wrappers.ServiceExceptions
import
InvalidArgumentException
...
...
@@ -26,8 +26,6 @@ from .Errors import (
ERROR_BAD_ENDPOINT
,
ERROR_DELETE
,
ERROR_GET
,
ERROR_GET_INIT
,
ERROR_MISSING_KPI
,
ERROR_SAMPLETYPE
,
ERROR_SET
,
ERROR_SUBSCRIBE
,
ERROR_UNSUBSCRIBE
)
LOGGER
=
logging
.
getLogger
(
__name__
)
def
check_connect_rules
(
device_config
:
DeviceConfig
)
->
Dict
[
str
,
Any
]:
connection_config_rules
=
dict
()
unexpected_config_rules
=
list
()
...
...
@@ -79,14 +77,10 @@ def populate_endpoints(device : Device, driver : _Driver, monitoring_loops : Mon
device_uuid
=
device
.
device_id
.
device_uuid
.
uuid
resources_to_get
=
[
RESOURCE_ENDPOINTS
]
LOGGER
.
warning
(
'
resources_to_get = {:s}
'
.
format
(
str
(
resources_to_get
)))
results_getconfig
=
driver
.
GetConfig
(
resources_to_get
)
LOGGER
.
warning
(
'
results_getconfig = {:s}
'
.
format
(
str
(
results_getconfig
)))
errors
:
List
[
str
]
=
list
()
for
endpoint
in
results_getconfig
:
LOGGER
.
warning
(
'
endpoint = {:s}
'
.
format
(
str
(
endpoint
)))
if
len
(
endpoint
)
!=
2
:
errors
.
append
(
ERROR_BAD_ENDPOINT
.
format
(
device_uuid
,
str
(
endpoint
)))
continue
...
...
@@ -96,8 +90,6 @@ def populate_endpoints(device : Device, driver : _Driver, monitoring_loops : Mon
errors
.
append
(
ERROR_GET
.
format
(
device_uuid
,
str
(
resource_key
),
str
(
resource_value
)))
continue
LOGGER
.
warning
(
'
resource_value = {:s}
'
.
format
(
str
(
resource_value
)))
endpoint_uuid
=
resource_value
.
get
(
'
uuid
'
)
device_endpoint
=
device
.
device_endpoints
.
add
()
...
...
@@ -112,8 +104,6 @@ def populate_endpoints(device : Device, driver : _Driver, monitoring_loops : Mon
device_endpoint
.
kpi_sample_types
.
append
(
kpi_sample_type
)
monitoring_loops
.
add_resource_key
(
device_uuid
,
endpoint_uuid
,
kpi_sample_type
,
monitor_resource_key
)
LOGGER
.
warning
(
'
device.device_endpoints = {:s}
'
.
format
(
str
(
device
.
device_endpoints
)))
LOGGER
.
warning
(
'
errors = {:s}
'
.
format
(
str
(
errors
)))
return
errors
def
_raw_config_rules_to_grpc
(
...
...
This diff is collapsed.
Click to expand it.
src/device/service/driver_api/DriverInstanceCache.py
+
1
−
1
View file @
641ddae8
...
...
@@ -84,7 +84,7 @@ def get_driver(driver_instance_cache : DriverInstanceCache, device : Device) ->
driver_filter_fields
=
get_device_driver_filter_fields
(
device
)
connect_rules
=
get_connect_rules
(
device
.
device_config
)
LOGGER
.
info
(
'
[get_driver] connect_rules = {:s}
'
.
format
(
str
(
connect_rules
)))
#
LOGGER.info('[get_driver] connect_rules = {:s}'.format(str(connect_rules)))
address
=
connect_rules
.
get
(
'
address
'
,
'
127.0.0.1
'
)
port
=
connect_rules
.
get
(
'
port
'
,
'
0
'
)
settings
=
connect_rules
.
get
(
'
settings
'
,
'
{}
'
)
...
...
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