Commit 4f5e3aa9 by Sunil Kumar Veerappa

UPdated M2DC sysinfo file

parent 481a86ea
......@@ -29,16 +29,18 @@ import fcntl, socket, struct
import hashlib
from requests import auth
import paramiko
import cyborg.conf
from cyborg.objects.driver_objects import driver_deployable, driver_device,\
driver_attach_handle, driver_controlpath_id
from cyborg.common import constants
#Added for sending request to RECSMaster
RECS_URL="http://admin:admin@localhost:8080/redfish/v1/"
headers = {'Content-Type': 'application/json'}
CONF = cyborg.conf.CONF
RECS_URL = None
list_fpga_id=[]
list_fpga_id1=["fpga1","fpga2"]
list_fpga_ip1 =["192.168.2.159","192.168.2.159"]
......@@ -47,6 +49,9 @@ list_fpga_ip=[]
LOG = logging.getLogger(__name__)
def get_configuration():
global RECS_URL
RECS_URL = str(CONF.agent.url)
def available_Systems():
listed_systems = []
......@@ -62,20 +67,19 @@ def available_Systems():
return listed_systems
def checkFPGA(system_id):
response = requests.get(RECS_URL+'Systems/' + system_id, headers=headers,
auth=('admin', 'admin'))
response = requests.get(RECS_URL+'Systems/' + system_id, headers=headers)
json_data = json.loads(response.text)
if json_data["ProcessorSummary"]["Model"] == "Stratix 10 SX 2800":
response_eth = requests.get(RECS_URL + 'Systems/' + system_id + "/EthernetInterfaces/" + system_id + "_IF_Eth_0",
headers=headers, auth=('admin', 'admin'))
headers=headers)
json_data_eth = json.loads(response_eth.text)
if json_data_eth["PermanentMACAddress"] not in list_fpga_mac:
list_fpga_mac.append(json_data_eth["PermanentMACAddress"])
return True
return False
def list_fpga():
get_configuration()
available_systems_RECSmaster=[]
# First list down all the systems from RECS master
available_systems_RECSmaster = available_Systems()
......@@ -85,9 +89,6 @@ def list_fpga():
if system not in list_fpga_id:
list_fpga_id.append(system)
def _generate_dep_list(item):
dep_list = []
driver_dep = driver_deployable.DriverDeployable()
......@@ -99,7 +100,6 @@ def _generate_dep_list(item):
dep_list.append(driver_dep)
return dep_list
def _generate_attach_handle(item):
driver_ah = driver_attach_handle.DriverAttachHandle()
driver_ah.attach_type = "PCI"
......@@ -107,15 +107,13 @@ def _generate_attach_handle(item):
driver_ah.in_use = False
return driver_ah
def _generate_controlpath_id(item):
driver_cpid = driver_controlpath_id.DriverControlPathID()
driver_cpid.cpid_type = "PCI"
driver_cpid.cpid_info = "test_cyborg"+item
return driver_cpid
def _generate_driver_device(item,ip_item, device_data):
def _generate_driver_device(item, ip_item, device_data):
driver_device_obj = driver_device.DriverDevice()
driver_device_obj.vendor = "stratix 10 "+device_data["vendorName"]
driver_device_obj.model = device_data["physicalName"]
......@@ -136,7 +134,6 @@ def extractData(Data):
deviceDict["physicalName"] = phy_name
return deviceDict
def discover_boards():
devs = []
device_data={}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment