2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +00:00

Recognize ESXi media

Fingerprint ESXi media, at
least tested with ESXi 7 media.
This commit is contained in:
Jarrod Johnson 2020-06-04 14:58:52 -04:00
parent 0016c31fef
commit 58e7a1f0b4

View File

@ -20,6 +20,7 @@ READFILES = set([
'README.diskdefines',
'media.1/products',
'media.2/products',
'.DISCINFO',
'.discinfo',
])
@ -143,6 +144,24 @@ def check_centos(isoinfo):
return None
return {'name': 'centos-{0}-{1}'.format(ver, arch), 'method': EXTRACT, 'category': cat}
def check_esxi(isoinfo):
if '.DISCINFO' not in isoinfo[1]:
return
isesxi = False
version = None
for line in isoinfo[1]['.DISCINFO'].split(b'\n'):
if b'ESXi' == line:
isesxi = True
if line.startswith(b'Version: '):
_, version = line.split(b' ', 1)
if not isinstance(version, str):
version = version.decode('utf8')
if isesxi and version:
return {
'name': 'esxi-{0}'.format(version),
'method': EXTRACT,
'category': 'esxi{0}'.format(version.split('.', 1)[0])
}
def check_ubuntu(isoinfo):
if 'README.diskdefines' not in isoinfo[1]: