mirror of
https://github.com/Telecominfraproject/ols-nos.git
synced 2025-11-02 02:57:45 +00:00
What I did it Add new platform arm64-ragile_ra-b6010-48gt4x-r0 (Centec) ASIC Vendor: Centec Switch ASIC: Centec Port Config: 48x1G+4x10G Why I did it Add new platform RA-B6010-48GT4X How I did it Add new platform RA-B6010-48GT4X Signed-off-by: pettershao-ragilenetworks <pettershao@ragilenetworks.com>
24 lines
686 B
Python
Executable File
24 lines
686 B
Python
Executable File
# -*- coding: UTF-8 -*-
|
|
import os
|
|
|
|
def get_machine_info():
|
|
if not os.path.isfile('/host/machine.conf'):
|
|
return None
|
|
machine_vars = {}
|
|
with open('/host/machine.conf') as machine_file:
|
|
for line in machine_file:
|
|
tokens = line.split('=')
|
|
if len(tokens) < 2:
|
|
continue
|
|
machine_vars[tokens[0]] = tokens[1].strip()
|
|
return machine_vars
|
|
|
|
def get_platform_info(machine_info):
|
|
if machine_info != None:
|
|
if 'onie_platform' in machine_info:
|
|
return machine_info['onie_platform']
|
|
elif 'aboot_platform' in machine_info:
|
|
return machine_info['aboot_platform']
|
|
return None
|
|
|