From 5c7b236e96cacca16837f8d901c03b43da6ecbc9 Mon Sep 17 00:00:00 2001 From: "jiagen.luo" Date: Mon, 6 Dec 2021 18:20:27 +0800 Subject: [PATCH 1/3] update alert info time --- delfin/drivers/hpe/hpe_msa/ssh_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/delfin/drivers/hpe/hpe_msa/ssh_handler.py b/delfin/drivers/hpe/hpe_msa/ssh_handler.py index d0f5c38a9..a752a435b 100644 --- a/delfin/drivers/hpe/hpe_msa/ssh_handler.py +++ b/delfin/drivers/hpe/hpe_msa/ssh_handler.py @@ -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 = { @@ -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 @@ -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) From 0e437279b87feed1e8bd844519255ab058b05fb1 Mon Sep 17 00:00:00 2001 From: "jiagen.luo" Date: Mon, 6 Dec 2021 21:15:01 +0800 Subject: [PATCH 2/3] update vendor info,alert info --- delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py b/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py index 34b08eed3..e7860fa76 100644 --- a/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py +++ b/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py @@ -297,7 +297,7 @@ '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', From f3ad701eabc75ccf6d73ece65d39a67e2ed3bdcc Mon Sep 17 00:00:00 2001 From: "jiagen.luo" Date: Mon, 6 Dec 2021 21:17:42 +0800 Subject: [PATCH 3/3] update vendor info,alert info --- delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py | 1 - 1 file changed, 1 deletion(-) diff --git a/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py b/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py index e7860fa76..10ef2a5f2 100644 --- a/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py +++ b/delfin/tests/unit/drivers/hpe/hpe_msa/test_constans.py @@ -301,7 +301,6 @@ 'resource_type': '557', 'sequence_number': 'A891', 'severity': 'ERROR', - 'time': '2021-11-12 08:16:20', 'type': 'EquipmentAlarm' } ]