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

Fix oceanstor driver issue #276

Merged
merged 2 commits into from
Aug 14, 2020
Merged
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
7 changes: 4 additions & 3 deletions delfin/drivers/huawei/oceanstor/alert_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import binascii
from datetime import datetime

from oslo_log import log
Expand Down Expand Up @@ -98,12 +97,14 @@ def parse_alert(self, context, alert):

description = alert['hwIsmReportingAlarmAdditionInfo']
if self._is_hex(description):
description = binascii.unhexlify(description[2:])
description = bytes.fromhex(description[2:]).decode('ascii')
alert_model['description'] = description

recovery_advice = alert['hwIsmReportingAlarmRestoreAdvice']
if self._is_hex(recovery_advice):
recovery_advice = binascii.unhexlify(recovery_advice[2:])
recovery_advice = bytes.fromhex(
recovery_advice[2:]).decode('ascii')

alert_model['recovery_advice'] = recovery_advice

alert_model['resource_type'] = constants.DEFAULT_RESOURCE_TYPE
Expand Down