1
0
mirror of https://github.com/Napsty/check_esxi_hardware.git synced 2024-11-22 02:13:46 +01:00

Fix dell support links (#38)

This commit is contained in:
Phil Randal 2019-07-01 09:39:59 +01:00 committed by Claudio Kuenzler
parent 08cf10de24
commit ff3228b804

View File

@ -264,6 +264,9 @@
#@ Author : Claudio Kuenzler #@ Author : Claudio Kuenzler
#@ Reason : Allow regular expressions from ignore list (-r) #@ Reason : Allow regular expressions from ignore list (-r)
#@--------------------------------------------------- #@---------------------------------------------------
#@ Date : 20190701
#@ Author : Phil Randal (phil.randal@gmail.com)
#@ Reason : Fix lookup of warranty info for Dell (again)
from __future__ import print_function from __future__ import print_function
import sys import sys
@ -273,7 +276,7 @@ import re
import pkg_resources import pkg_resources
from optparse import OptionParser,OptionGroup from optparse import OptionParser,OptionGroup
version = '20190510' version = '20190701'
NS = 'root/cimv2' NS = 'root/cimv2'
hosturl = '' hosturl = ''
@ -445,7 +448,7 @@ def urlised_server_info(vendor, country, server_info):
#server_inf = server_info #server_inf = server_info
if vendor == 'dell' : if vendor == 'dell' :
# Dell support URLs (idea and tables borrowed from check_openmanage) # Dell support URLs (idea and tables borrowed from check_openmanage)
du = 'http://www.dell.com/support/troubleshooting/' + dell_country(country) + '19/Product/poweredge-' du = 'http://www.dell.com/support/home/' + dell_country(country) + '04/product-support/product/poweredge-'
if (server_info is not None) : if (server_info is not None) :
p=re.match('(.*)PowerEdge (.*) (.*)',server_info) p=re.match('(.*)PowerEdge (.*) (.*)',server_info)
if (p is not None) : if (p is not None) :
@ -453,7 +456,7 @@ def urlised_server_info(vendor, country, server_info):
if md == 'R210 II': if md == 'R210 II':
md='r210-2' md='r210-2'
md=md.lower() md=md.lower()
server_info = p.group(1) + '<a href="' + du + md + '#ui-tabs-4">PowerEdge ' + p.group(2)+'</a> ' + p.group(3) server_info = p.group(1) + '<a href="' + du + md + '/">PowerEdge ' + p.group(2)+'</a> ' + p.group(3)
elif vendor == 'hp': elif vendor == 'hp':
return server_info return server_info
elif vendor == 'ibm': elif vendor == 'ibm':
@ -468,8 +471,8 @@ def urlised_server_info(vendor, country, server_info):
def system_tag_url(vendor,country): def system_tag_url(vendor,country):
if vendor == 'dell': if vendor == 'dell':
# Dell support sites # Dell support sites
supportsite = 'http://www.dell.com/support/troubleshooting/' supportsite = 'http://www.dell.com/support/home/'
dellsuffix = 'nodhs1/Index?t=warranty&servicetag=' dellsuffix = '19/product-support/servicetag/'
# warranty URLs for different country codes # warranty URLs for different country codes
return supportsite + dell_country(country) + dellsuffix return supportsite + dell_country(country) + dellsuffix