Method: Cisco::Platform.chassis

Defined in:
lib/cisco_node_utils/platform.rb

.chassisObject

Returns chassis hash with keys “descr”, “pid”, “vid”, “sn” Ex: { ‘descr’ => ‘Nexus9000 C9396PX Chassis’,

'pid'   => 'N9K-C9396PX',
'vid'   => 'V02',
'sn'    => 'SAL1812NTBP' }


94
95
96
97
98
99
100
101
102
103
104
# File 'lib/cisco_node_utils/platform.rb', line 94

def self.chassis
  node.cache_flush # TODO: investigate why this is needed
  chas = config_get('inventory', 'chassis')
  return nil if chas.nil?
  {
    'descr' => chas['desc'].tr('"', ''),
    'pid'   => chas['productid'],
    'vid'   => chas['vendorid'],
    'sn'    => chas['serialnum'],
  }
end