testimage/testsdk/selftest: Avoid platform.distro_identifier deprecation warnings

Use our own lsb function instead as used elsewhere by the codebase.

(From OE-Core rev: acac45a6fd604d28ef7c23d67482af3d7e8bcfe3)

(From OE-Core rev: 570256a64af5a3fa994a20a5cc4c74d59ffc361f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2018-11-15 14:38:19 +00:00
parent ea1ffae258
commit 237ff3e462
3 changed files with 4 additions and 3 deletions

View File

@@ -151,7 +151,7 @@ def get_testimage_configuration(d, test_type, machine):
'IMAGE_BASENAME': d.getVar("IMAGE_BASENAME"),
'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"),
'STARTTIME': d.getVar("DATETIME"),
'HOST_DISTRO': ('-'.join(platform.linux_distribution())).replace(' ', '-'),
'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'),
'LAYERS': get_layers(d.getVar("BBLAYERS"))}
return configuration
get_testimage_configuration[vardepsexclude] = "DATETIME"

View File

@@ -23,7 +23,7 @@ def get_sdk_configuration(d, test_type):
'IMAGE_BASENAME': d.getVar("IMAGE_BASENAME"),
'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"),
'STARTTIME': d.getVar("DATETIME"),
'HOST_DISTRO': ('-'.join(platform.linux_distribution())).replace(' ', '-'),
'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'),
'LAYERS': get_layers(d.getVar("BBLAYERS"))}
return configuration
get_sdk_configuration[vardepsexclude] = "DATETIME"

View File

@@ -11,6 +11,7 @@ from shutil import copyfile
from random import choice
import oeqa
import oe
from oeqa.core.context import OETestContext, OETestContextExecutor
from oeqa.core.exception import OEQAPreRun, OEQATestNotFound
@@ -223,7 +224,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor):
configuration = {'TEST_TYPE': 'oeselftest',
'STARTTIME': args.test_start_time,
'MACHINE': self.tc.td["MACHINE"],
'HOST_DISTRO': ('-'.join(platform.linux_distribution())).replace(' ', '-'),
'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'),
'HOST_NAME': metadata['hostname'],
'LAYERS': metadata['layers']}
return configuration