Both Hpe and Hp should be considered for Oem entries

Change-Id: Ia9ca019d176fd72a9002a377707fae66268c83fa
This commit is contained in:
Bruno Cornec 2019-03-30 01:24:49 +01:00
parent b80503b10d
commit 520bdc5605
5 changed files with 42 additions and 11 deletions

View File

@ -68,7 +68,7 @@ sshport:
# a QEMU rhel-3-i286 here means that the VM will be named rhel-3-i386.qemu
#
vmlist:
python-redfish: opensuse-12.3-i386,debian-8-i386,ubuntu-16.04-i386,mageia-5-i386,mageia-5-x86_64,fedora-23-x86_64,rhel-7-x86_64,opensuse-12.3-x86_64,sles-12-x86_64,debian-8-x86_64,ubuntu-16.04-x86_64
python-redfish: rhel-6-i386,sles-11-i386,mageia-5-i386,rhel-6-x86_64,rhel-7-x86_64,sles-12-x86_64,sles-15-x86_64
#
#
# Valid values for vmtype are
@ -102,7 +102,7 @@ vmlist:
#
# Supported distribution for python-redfish
velist:
python-redfish: opensuse-42.2-x86_64,centos-7-x86_64,fedora-25-x86_64,debian-8-x86_64,mageia-5-x86_64,ubuntu-16.04-x86_64
python-redfish: centos-6-x86_64,centos-7-x86_64,debian-8-x86_64,debian-9-x86_64,ubuntu-16.04-x86_64,ubuntu-17.10-x86_64,ubuntu-18.04-x86_64,ubuntu-18.10-x86_64,mageia-5-x86_64,mageia-6-x86_64,fedora-25-x86_64,fedora-26-x86_64,fedora-27-x86_64,fedora-28-x86_64,fedora-29-x86_64,opensuse-42.1-x86_64,opensuse-42.2-x86_64,opensuse-42.3-x86_64,opensuse-15.0-x86_64,opensuse-15.1-x86_64
#
# VE params
vetype:

View File

@ -240,7 +240,7 @@ if __name__ == '__main__':
render_template("manager_info.template")
def display_chassis_info(redfish_data):
# Display system information using jinja2 template
# Display chassis information using jinja2 template
render_template("chassis_info.template")
def display_system_info(redfish_data):

View File

@ -50,7 +50,7 @@ Ethernet Interface :
This system has no ethernet interface as Redfish standard data
{%- endif %}
Looking for potential OEM information :
{%- if system.data.Oem.Hpe %}
{%- if system.data.Oem.Hpe or system.data.Oem.Hp %}
Supplemental information from HPE OEM part.
{%- if system.network_adapters_collection %}
{%- for networkadapter_index in system.network_adapters_collection.network_adapters_dict | sort %}
@ -84,7 +84,7 @@ Simple Storage :
This system has no simple storage as Redfish standard data
{%- endif %}
Looking for potential OEM information :
{%- if system.data.Oem.Hpe %}
{%- if system.data.Oem.Hpe or system.data.Oem.Hp %}
Supplemental information from HPE OEM part.
{%- if system.smart_storage %}
{%- for array_controllers_index in system.smart_storage.array_controllers_collection.array_controllers_dict | sort %}

View File

@ -75,7 +75,7 @@ versions of resource types.
On HTTP POST to create:
WHen POSTing to create a resource (e.g. create an account or session) the
When POSTing to create a resource (e.g. create an account or session) the
guarantee is that a successful response includes a "Location" HTTP header
indicating the resource URI of the newly created resource. The POST may also
include a representation of the newly created object in a JSON response body
@ -99,7 +99,7 @@ JSON-SCHEMA:
The json-schema available at /redfish/v1/Schemas governs the content of the
resources, but keep in mind:
* not every property in the schema is implemented in every implementation.
* some properties are schemed to allow both null and anotehr type like string
* some properties are schemed to allow both null and another type like string
* or integer.
Robust client code should check both the existence and type of interesting
@ -168,7 +168,7 @@ class RedfishConnection(object):
"""Initialize a connection to a Redfish service."""
# Specify a name for the logger as recommended by the logging
# documentation. However for strange reason requests logs are not
# anymore capture in the log file.
# anymore captured in the log file.
# TODO : Check strange behavior about requests logs.
config.logger = config.initialize_logger(config.REDFISH_LOGFILE,
config.CONSOLE_LOGGER_LEVEL,
@ -184,7 +184,7 @@ class RedfishConnection(object):
self.connection_parameters.enforceSSL = enforceSSL
self.connection_parameters.verify_cert = verify_cert
# Use DMTF mockup or not
# Use a mockup or not (like the DMTF or HPE one)
self.__simulator = simulator
# Session attributes
@ -233,7 +233,7 @@ class RedfishConnection(object):
# Structure change with mockup 1.0.0, there is no links
# section anymore.
# ===================================================================
# TODO : Add a switch to allow the both structure
# TODO : Add a switch to allow both structures
# ===================================================================
# standard
@ -259,7 +259,8 @@ class RedfishConnection(object):
try:
self.Chassis = standard.ChassisCollection(
self.Root.get_link_url("Chassis"), self.connection_parameters)
self.Root.get_link_url("Chassis"),
self.connection_parameters)
except AttributeError:
self.Chassis = None

View File

@ -212,6 +212,8 @@ class Systems(Device):
# This means we don't have Processors detailed data
self.simple_storage_collection = None
hpeflag = False
hpflag = False
try:
self.data.Oem.Hpe
try:
@ -233,6 +235,34 @@ class Systems(Device):
# This means we don't have SmartStorage
self.smart_storage = None
except AttributeError:
# This means we don't have Hpe oem data
hpeflag = True
try:
self.data.Oem.Hp
try:
self.network_adapters_collection = \
hpe.NetworkAdaptersCollection(
self.get_link_url('NetworkAdapters',
self.data.Oem.Hp.Links),
connection_parameters)
except AttributeError:
# This means we don't have NetworkAdapters
self.network_adapters_collection = None
try:
self.smart_storage = \
hpe.SmartStorage(
self.get_link_url('SmartStorage',
self.data.Oem.Hp.Links),
connection_parameters)
except AttributeError:
# This means we don't have SmartStorage
self.smart_storage = None
except AttributeError:
# This means we don't have Hp oem data
hpflag = True
if hpeflag and hpflag:
# This means we don't have oem data
self.data.Oem = None