Files
deb-python-proliantutils/proliantutils/ilo/common.py
Anusha Ramineni ec4c3f4323 Bug Fixes
This commit addresses some of the bug fixes which includes -
1. Changing boot_mode to lower, as accepted by set_pending_boot_mode
2. Increasing the timeout and number of retries to check for status
   of iLO
3. Fallback to RIBCL for reset_ilo for 'gen9' servers.

Change-Id: Iacd122ffecaecbda671bcf21fad660f5c9592a61
2015-04-08 22:00:48 +05:30

42 lines
1.2 KiB
Python

# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Common functionalities used by both RIBCL and RIS."""
import time
from proliantutils import exception
# Max number of times an operation to be retried
RETRY_COUNT = 10
def wait_for_ilo_after_reset(ilo_object):
"""Checks if iLO is up after reset."""
retry_count = RETRY_COUNT
# Delay for 10 sec, for the reset operation to take effect.
time.sleep(10)
while retry_count:
try:
ilo_object.get_product_name()
break
except exception.IloError:
retry_count -= 1
time.sleep(5)
else:
msg = ('iLO is not up after reset.')
raise exception.IloConnectionError(msg)