Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update alert info time #351

Merged
merged 3 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions delfin/drivers/hpe/hpe_msa/ssh_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def list_storage_controller(self, storage_id):
cpu_info = data.get('sc-cpu-type')
memory_size = data.get('system-memory-size')
if memory_size is not None:
memory_size = memory_size + "MB"
memory_size += "MB"
system_memory_size = self.parse_string_to_bytes(
memory_size)
data_map = {
Expand Down Expand Up @@ -357,7 +357,8 @@ def list_alerts(self, query_para):
.SECONDS_TO_MS))
time_stamp = alert_map.get('time-stamp-numeric')
if time_stamp is not None:
occur_time = int(time_stamp)
occur_time = int(time_stamp) * consts.SecondsNumber\
.SECONDS_TO_MS
if not alert_util.is_alert_in_time_range(query_para,
occur_time):
continue
Expand Down Expand Up @@ -390,7 +391,6 @@ def list_alerts(self, query_para):
'description': description,
'resource_type': resource_type,
'location': location,
'time': alert_map.get('time-stamp'),
'match_key': hashlib.md5(match_key.encode()).hexdigest()
}
alert_list.append(alert_model)
Expand Down
3 changes: 1 addition & 2 deletions delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,10 @@
'description': 'Management',
'location': 'An Enclosure Management Processor(EMP)',
'match_key': 'd0317252aed04fd8b68e79d7eab08277',
'occur_time': 1636704980,
'occur_time': 1636704980000,
'resource_type': '557',
'sequence_number': 'A891',
'severity': 'ERROR',
'time': '2021-11-12 08:16:20',
'type': 'EquipmentAlarm'
}
]
Expand Down