mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Platform method updates.
This commit is contained in:
@@ -13,7 +13,6 @@ import pprint
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
|
||||
import yaml
|
||||
import onl.YamlUtils
|
||||
|
||||
@@ -173,14 +172,8 @@ class OnlPlatformBase(object):
|
||||
def baseconfig(self):
|
||||
return True
|
||||
|
||||
def manufacturer(self):
|
||||
raise Exception("Manufacturer is not set.")
|
||||
|
||||
def model(self):
|
||||
raise Exception("Model is not set.")
|
||||
|
||||
def platform(self):
|
||||
raise Exception("Platform is not set.")
|
||||
return self.PLATFORM
|
||||
|
||||
def baseplatform(self):
|
||||
p = self.platform()
|
||||
@@ -188,8 +181,7 @@ class OnlPlatformBase(object):
|
||||
return p
|
||||
|
||||
def description(self):
|
||||
return "%s %s (%s)" % (self.manufacturer(), self.model(),
|
||||
self.platform())
|
||||
return "%s %s" % (self.MANUFACTURER, self.MODEL)
|
||||
|
||||
def serialnumber(self):
|
||||
return self.onie_info.SERIAL_NUMBER
|
||||
@@ -200,8 +192,8 @@ class OnlPlatformBase(object):
|
||||
|
||||
|
||||
# ONL Platform Information Tree
|
||||
def opit_oid(self):
|
||||
return "1.3.6.1.4.1.37538.2.1000"
|
||||
def platform_information_tree(self):
|
||||
return "1.3.6.1.4.1.42623.1.1"
|
||||
|
||||
# ONL Platform Information General Tree
|
||||
def opitg_oid(self):
|
||||
@@ -215,16 +207,11 @@ class OnlPlatformBase(object):
|
||||
def opitv_oid(self):
|
||||
return self.opit_oid() + ".2"
|
||||
|
||||
def sys_oid_vendor(self):
|
||||
return ".37538"
|
||||
|
||||
def sys_oid_platform(self):
|
||||
raise Exception("sys_oid_platform() is not set.")
|
||||
|
||||
def sys_object_id(self):
|
||||
return ( self.opitv_oid() +
|
||||
self.sys_oid_vendor() +
|
||||
self.sys_oid_platform());
|
||||
return "%s.%s%s" % (self.opitv_oid(), self.PRIVATE_ENTERPRISE_NUMBER, self.SYS_OBJECT_ID)
|
||||
|
||||
def onie_version(self):
|
||||
return self.onie_info.ONIE_VERSION
|
||||
@@ -270,19 +257,18 @@ class OnlPlatformBase(object):
|
||||
return 2
|
||||
|
||||
def __str__(self):
|
||||
s = """Manufacturer: %s
|
||||
Model: %s
|
||||
Platform: %s
|
||||
Description: %s
|
||||
s = """Model: %s
|
||||
Manufacturer: %s
|
||||
Ports: %s (%s)
|
||||
System Object Id: %s
|
||||
System Information:
|
||||
%s
|
||||
%s
|
||||
""" % (
|
||||
self.manufacturer(),
|
||||
self.model(),
|
||||
self.platform(),
|
||||
self.description(),
|
||||
self.MODEL,
|
||||
self.MANUFACTURER,
|
||||
self.PORT_COUNT,
|
||||
self.PORT_CONFIG,
|
||||
self.sys_object_id(),
|
||||
str(self.onie_info),
|
||||
str(self.platform_info),
|
||||
@@ -298,7 +284,22 @@ Warning: %s
|
||||
return s
|
||||
|
||||
|
||||
class OnlPlatformPortConfig_48x1_4x10(object):
|
||||
PORT_COUNT=52
|
||||
PORT_CONFIG="48x1 + 4x10"
|
||||
|
||||
class OnlPlatformPortConfig_48x10_4x40(object):
|
||||
PORT_COUNT=52
|
||||
PORT_CONFIG="48x10 + 4x40"
|
||||
|
||||
class OnlPlatformPortConfig_48x10_6x40(object):
|
||||
PORT_COUNT=54
|
||||
PORT_CONFIG="48x10 + 6x40"
|
||||
|
||||
class OnlPlatformPortConfig_32x40(object):
|
||||
PORT_COUNT=32
|
||||
PORT_CONFIG="32x40"
|
||||
|
||||
class OnlPlatformPortConfig_32x100(object):
|
||||
PORT_COUNT=32
|
||||
PORT_CONFIG="32x100"
|
||||
|
||||
Reference in New Issue
Block a user