fixes for CI.
This commit is contained in:
parent
a9b6b039c6
commit
f4ff32f1b0
3 changed files with 35 additions and 38 deletions
|
|
@ -1,15 +1,9 @@
|
||||||
import logging
|
|
||||||
import subprocess
|
|
||||||
import re
|
|
||||||
|
|
||||||
from netbox_agent.config import netbox_instance as nb, config
|
from netbox_agent.config import netbox_instance as nb, config
|
||||||
from netbox_agent.misc import is_tool
|
from netbox_agent.misc import is_tool
|
||||||
from netbox_agent.raid.hp import HPRaid
|
from netbox_agent.raid.hp import HPRaid
|
||||||
from netbox_agent.raid.storcli import StorcliRaid
|
from netbox_agent.raid.storcli import StorcliRaid
|
||||||
from netbox_agent.lshw import LSHW
|
from netbox_agent.lshw import LSHW
|
||||||
|
|
||||||
from pprint import pprint
|
|
||||||
|
|
||||||
INVENTORY_TAG = {
|
INVENTORY_TAG = {
|
||||||
'cpu': {'name': 'hw:cpu', 'slug': 'hw-cpu'},
|
'cpu': {'name': 'hw:cpu', 'slug': 'hw-cpu'},
|
||||||
'disk': {'name': 'hw:disk', 'slug': 'hw-disk'},
|
'disk': {'name': 'hw:disk', 'slug': 'hw-disk'},
|
||||||
|
|
@ -109,7 +103,12 @@ class Inventory():
|
||||||
description=description
|
description=description
|
||||||
)
|
)
|
||||||
|
|
||||||
logging.info('Creating inventory item {} {}/{} {} '.format(vendor, name, serial, description))
|
logging.info('Creating inventory item {} {}/{} {} '.format(
|
||||||
|
vendor,
|
||||||
|
name,
|
||||||
|
serial,
|
||||||
|
description)
|
||||||
|
)
|
||||||
|
|
||||||
def get_hw_motherboards(self):
|
def get_hw_motherboards(self):
|
||||||
motherboards = []
|
motherboards = []
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
import logging
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import getpass
|
import getpass
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from pprint import pprint
|
|
||||||
|
|
||||||
class LSHW():
|
class LSHW():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -80,7 +77,8 @@ class LSHW():
|
||||||
self.disks.append(d)
|
self.disks.append(d)
|
||||||
|
|
||||||
elif "nvme" in obj["configuration"]["driver"]:
|
elif "nvme" in obj["configuration"]["driver"]:
|
||||||
nvme = json.loads(subprocess.check_output(["nvme", '-list', '-o', 'json'],encoding='utf8'))
|
nvme = json.loads(subprocess.check_output(["nvme", '-list', '-o', 'json'],
|
||||||
|
encoding='utf8'))
|
||||||
|
|
||||||
d = {}
|
d = {}
|
||||||
d["vendor"] = obj["vendor"]
|
d["vendor"] = obj["vendor"]
|
||||||
|
|
@ -96,7 +94,6 @@ class LSHW():
|
||||||
self.disks.append(d)
|
self.disks.append(d)
|
||||||
|
|
||||||
def find_cpus(self, obj):
|
def find_cpus(self, obj):
|
||||||
pprint(obj)
|
|
||||||
c = {}
|
c = {}
|
||||||
c["product"] = obj["product"]
|
c["product"] = obj["product"]
|
||||||
c["vendor"] = obj["vendor"]
|
c["vendor"] = obj["vendor"]
|
||||||
|
|
@ -107,7 +104,7 @@ class LSHW():
|
||||||
|
|
||||||
def find_memories(self, obj):
|
def find_memories(self, obj):
|
||||||
if "children" not in obj:
|
if "children" not in obj:
|
||||||
print("not a DIMM memory.")
|
# print("not a DIMM memory.")
|
||||||
return
|
return
|
||||||
|
|
||||||
for dimm in obj["children"]:
|
for dimm in obj["children"]:
|
||||||
|
|
|
||||||
3
netbox_agent/vendors/supermicro.py
vendored
3
netbox_agent/vendors/supermicro.py
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
from netbox_agent.location import Slot
|
from netbox_agent.location import Slot
|
||||||
from netbox_agent.server import ServerBase
|
from netbox_agent.server import ServerBase
|
||||||
|
|
||||||
|
|
@ -14,6 +15,7 @@ from netbox_agent.server import ServerBase
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class SupermicroHost(ServerBase):
|
class SupermicroHost(ServerBase):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(SupermicroHost, self).__init__(*args, **kwargs)
|
super(SupermicroHost, self).__init__(*args, **kwargs)
|
||||||
|
|
@ -55,4 +57,3 @@ class SupermicroHost(ServerBase):
|
||||||
if not self.is_blade():
|
if not self.is_blade():
|
||||||
return None
|
return None
|
||||||
return 'Chassis {}'.format(self.get_chassis_service_tag())
|
return 'Chassis {}'.format(self.get_chassis_service_tag())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue