cache sysinfo (we use it a lot, it will not change)
parent
9cb4880747
commit
3987c2c0d8
|
@ -87,16 +87,19 @@ class Config
|
|||
#
|
||||
def sysinfo
|
||||
request = Packet.create_request('stdapi_sys_config_sysinfo')
|
||||
response = client.send_request(request)
|
||||
if @sysinfo.nil?
|
||||
response = client.send_request(request)
|
||||
|
||||
{
|
||||
'Computer' => response.get_tlv_value(TLV_TYPE_COMPUTER_NAME),
|
||||
'OS' => response.get_tlv_value(TLV_TYPE_OS_NAME),
|
||||
'Architecture' => response.get_tlv_value(TLV_TYPE_ARCHITECTURE),
|
||||
'System Language' => response.get_tlv_value(TLV_TYPE_LANG_SYSTEM),
|
||||
'Domain' => response.get_tlv_value(TLV_TYPE_DOMAIN),
|
||||
'Logged On Users' => response.get_tlv_value(TLV_TYPE_LOGGED_ON_USER_COUNT)
|
||||
}
|
||||
@sysinfo = {
|
||||
'Computer' => response.get_tlv_value(TLV_TYPE_COMPUTER_NAME),
|
||||
'OS' => response.get_tlv_value(TLV_TYPE_OS_NAME),
|
||||
'Architecture' => response.get_tlv_value(TLV_TYPE_ARCHITECTURE),
|
||||
'System Language' => response.get_tlv_value(TLV_TYPE_LANG_SYSTEM),
|
||||
'Domain' => response.get_tlv_value(TLV_TYPE_DOMAIN),
|
||||
'Logged On Users' => response.get_tlv_value(TLV_TYPE_LOGGED_ON_USER_COUNT)
|
||||
}
|
||||
end
|
||||
@sysinfo
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue