Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
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
LOFAR2.0
tango
Commits
cddfb554
Commit
cddfb554
authored
3 years ago
by
Stefano Di Frischia
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-375
: archiver bugs fixing
parent
3e910d98
No related branches found
No related tags found
1 merge request
!153
Resolve L2SS-375 "Archiving load"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/toolkit/archiver.py
+16
-19
16 additions, 19 deletions
devices/toolkit/archiver.py
with
16 additions
and
19 deletions
devices/toolkit/archiver.py
+
16
−
19
View file @
cddfb554
...
...
@@ -201,27 +201,28 @@ class Archiver():
"""
if
(
len
(
attribute_name
.
split
(
'
/
'
))
!=
4
):
raise
AttributeFormatException
try
:
attributes
=
self
.
cm
.
AttributeSearch
(
attribute_name
)
a
=
[
a
for
a
in
attributes
if
a
.
lower
().
endswith
(
attribute_name
.
lower
())]
# handle cases differences
attributes
=
self
.
cm
.
AttributeSearch
(
attribute_name
.
lower
())
if
len
(
attributes
)
>
1
:
raise
Exception
(
"
MultipleAttributesMatched!
"
)
if
len
(
attributes
)
==
1
:
# Handle case same attribute_name r/rw
if
len
(
attributes
)
==
2
and
(
attributes
[
0
].
endswith
(
attributes
[
1
]
+
'
w
'
)
or
attributes
[
1
].
endswith
(
attributes
[
0
]
+
'
w
'
)):
return
True
else
:
raise
Exception
(
f
"
Multiple Attributes Matched!
{
attributes
}
"
)
elif
len
(
attributes
)
==
1
:
return
True
else
:
return
False
except
Exception
as
e
:
raise
Exception
from
e
def
update_archiving_attribute
(
self
,
attribute_name
:
str
,
polling_period
:
int
,
event_period
:
int
,
strategy
:
str
=
'
RUN
'
):
"""
Update the archiving properties of an attribute already in a subscriber list
"""
self
.
remove_attribute_from_archiver
(
attribute_name
)
time
.
sleep
(
1
)
time
.
sleep
(
2.
)
self
.
add_attribute_to_archiver
(
attribute_name
,
polling_period
,
event_period
,
strategy
)
time
.
sleep
(
1
)
time
.
sleep
(
2.
)
self
.
start_archiving_attribute
(
attribute_name
)
logger
.
warning
(
f
"
Attribute
{
attribute_name
}
successfully updated!
"
)
def
get_subscriber_attributes
(
self
,
es_name
:
str
=
None
):
"""
...
...
@@ -242,13 +243,9 @@ class Archiver():
es
=
DeviceProxy
(
es_name
)
else
:
es
=
self
.
es
try
:
attrs
=
es
.
AttributeList
or
[]
errs
=
es
.
AttributeErrorList
or
[]
return
dict
((
a
,
e
)
for
a
,
e
in
zip
(
attrs
,
errs
)
if
e
)
except
:
print
(
'
No attribute errors in the subscriber
'
)
return
{}
return
dict
((
a
,
e
)
for
a
,
e
in
zip
(
attrs
,
errs
)
if
e
)
or
{}
def
get_attribute_errors
(
self
,
attribute_name
:
str
):
"""
...
...
@@ -285,7 +282,7 @@ class Archiver():
if
self
.
is_attribute_archived
(
attribute_name
):
freq_dict
=
dict
((
a
,
r
)
for
a
,
r
in
zip
(
self
.
es
.
AttributeList
,
self
.
es
.
AttributeRecordFreqList
))
for
f
in
freq_dict
:
if
attribute_name
in
f
:
if
attribute_name
.
lower
()
in
f
:
return
freq_dict
.
get
(
f
,
0.
)
else
:
logger
.
warning
(
f
"
Attribute
{
attribute_name
}
not found!
"
)
...
...
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