Little refacto to support all Cartridge from this page, I assume they are very similare and will expose "Server Cartridge" at the end of the product name.
https://buy.hpe.com/us/en/moonshot-systems/moonshot-cartridges/proliant-server-cartridges/c/5378902?q=%3Arelevance%3Afacet_variantcategory%3AMoonshot%2BCartridges&text=&textSearch=&pageSize=20
This commit is contained in:
parent
80eb08e672
commit
08a42aa515
2 changed files with 12 additions and 6 deletions
|
|
@ -202,7 +202,7 @@ Tested on:
|
||||||
* HP ProLiant BL460c Gen8
|
* HP ProLiant BL460c Gen8
|
||||||
* HP ProLiant BL460c Gen9
|
* HP ProLiant BL460c Gen9
|
||||||
* HP ProLiant BL460c Gen10
|
* HP ProLiant BL460c Gen10
|
||||||
* HP Moonshot 1500 Enclosure (your `DeviceType` should have slots batch create with `Bay c[1-45n1]`) with HP ProLiant m710x Server Cartridge
|
* HP Moonshot 1500 Enclosure (your `DeviceType` should have slots batch create with `Bay c[1-45n1]`) with HP ProLiant m750, m710x, m510 Server Cartridge
|
||||||
|
|
||||||
### Pizzas
|
### Pizzas
|
||||||
|
|
||||||
|
|
|
||||||
16
netbox_agent/vendors/hp.py
vendored
16
netbox_agent/vendors/hp.py
vendored
|
|
@ -5,13 +5,18 @@ from netbox_agent.server import ServerBase
|
||||||
class HPHost(ServerBase):
|
class HPHost(ServerBase):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(HPHost, self).__init__(*args, **kwargs)
|
super(HPHost, self).__init__(*args, **kwargs)
|
||||||
|
self.manufacturer = "HP"
|
||||||
|
self.product = self.get_product_name()
|
||||||
if self.is_blade():
|
if self.is_blade():
|
||||||
self.hp_rack_locator = self._find_rack_locator()
|
self.hp_rack_locator = self._find_rack_locator()
|
||||||
self.manufacturer = "HP"
|
|
||||||
|
|
||||||
def is_blade(self):
|
def is_blade(self):
|
||||||
products = ("ProLiant BL", "ProLiant m710x")
|
if self.product.startswith("ProLiant BL"):
|
||||||
return self.get_product_name().startswith(products)
|
return True
|
||||||
|
elif self.product.startswith("ProLiant m") and self.product.endswith("Server Cartridge"):
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def _find_rack_locator(self):
|
def _find_rack_locator(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -22,7 +27,7 @@ class HPHost(ServerBase):
|
||||||
# FIXME: make a dmidecode function get_by_dminame() ?
|
# FIXME: make a dmidecode function get_by_dminame() ?
|
||||||
if self.is_blade():
|
if self.is_blade():
|
||||||
locator = dmidecode.get_by_type(self.dmi, 204)
|
locator = dmidecode.get_by_type(self.dmi, 204)
|
||||||
if self.get_product_name() == "ProLiant BL460c Gen10":
|
if self.product == "ProLiant BL460c Gen10":
|
||||||
locator = locator[0]["Strings"]
|
locator = locator[0]["Strings"]
|
||||||
return {
|
return {
|
||||||
"Enclosure Model": locator[2].strip(),
|
"Enclosure Model": locator[2].strip(),
|
||||||
|
|
@ -31,7 +36,8 @@ class HPHost(ServerBase):
|
||||||
"Enclosure Serial": locator[4].strip(),
|
"Enclosure Serial": locator[4].strip(),
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.get_product_name() == "ProLiant m710x Server Cartridge":
|
# HP ProLiant m750, m710x, m510 Server Cartridge
|
||||||
|
if self.product.startswith("ProLiant m") and self.product.endswith("Server Cartridge"):
|
||||||
locator = dmidecode.get_by_type(self.dmi, 2)
|
locator = dmidecode.get_by_type(self.dmi, 2)
|
||||||
chassis = dmidecode.get_by_type(self.dmi, 3)
|
chassis = dmidecode.get_by_type(self.dmi, 3)
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue