mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
sanity: Added explicit network error status in SanityCheckFailed event
If we fail a network test, a special flag is set in the SanityChekFailed event. This helps Hob identify the network error properly and display a special message to the user. [YOCTO #3025] (From OE-Core rev: 7877c4344db89237bba5f9a03342bfd9a03aebbf) Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
39a091fe1d
commit
7d95141c5a
@@ -54,9 +54,12 @@ python check_bblayers_conf() {
|
|||||||
f.write(''.join(lines))
|
f.write(''.join(lines))
|
||||||
}
|
}
|
||||||
|
|
||||||
def raise_sanity_error(msg, d):
|
def raise_sanity_error(msg, d, network_error=False):
|
||||||
if d.getVar("SANITY_USE_EVENTS", True) == "1":
|
if d.getVar("SANITY_USE_EVENTS", True) == "1":
|
||||||
bb.event.fire(bb.event.SanityCheckFailed(msg), d)
|
try:
|
||||||
|
bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d)
|
||||||
|
except TypeError:
|
||||||
|
bb.event.fire(bb.event.SanityCheckFailed(msg), d)
|
||||||
return
|
return
|
||||||
|
|
||||||
bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
|
bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
|
||||||
@@ -169,8 +172,9 @@ def check_sanity_tmpdir_change(tmpdir, data):
|
|||||||
# Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
|
# Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
|
||||||
testmsg = check_create_long_filename(tmpdir, "TMPDIR")
|
testmsg = check_create_long_filename(tmpdir, "TMPDIR")
|
||||||
# Check that we can fetch from various network transports
|
# Check that we can fetch from various network transports
|
||||||
|
errmsg = check_connectivity(data)
|
||||||
testmsg = testmsg + check_connectivity(data)
|
testmsg = testmsg + check_connectivity(data)
|
||||||
return testmsg
|
return testmsg, errmsg == ""
|
||||||
|
|
||||||
def check_sanity_version_change(data):
|
def check_sanity_version_change(data):
|
||||||
# Sanity checks to be done when SANITY_VERSION changes
|
# Sanity checks to be done when SANITY_VERSION changes
|
||||||
@@ -534,16 +538,18 @@ def check_sanity(sanity_data):
|
|||||||
last_sstate_dir = line.split()[1]
|
last_sstate_dir = line.split()[1]
|
||||||
|
|
||||||
sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1)
|
sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1)
|
||||||
|
network_error = False
|
||||||
if last_sanity_version < sanity_version:
|
if last_sanity_version < sanity_version:
|
||||||
messages = messages + check_sanity_version_change(sanity_data)
|
messages = messages + check_sanity_version_change(sanity_data)
|
||||||
messages = messages + check_sanity_tmpdir_change(tmpdir, sanity_data)
|
err, network_error = check_sanity_tmpdir_change(tmpdir, sanity_data)
|
||||||
|
messages = messages + err
|
||||||
messages = messages + check_sanity_sstate_dir_change(sstate_dir, sanity_data)
|
messages = messages + check_sanity_sstate_dir_change(sstate_dir, sanity_data)
|
||||||
else:
|
else:
|
||||||
if last_tmpdir != tmpdir:
|
if last_tmpdir != tmpdir:
|
||||||
messages = messages + check_sanity_tmpdir_change(tmpdir, sanity_data)
|
err, network_error = check_sanity_tmpdir_change(tmpdir, sanity_data)
|
||||||
|
messages = messages + err
|
||||||
if last_sstate_dir != sstate_dir:
|
if last_sstate_dir != sstate_dir:
|
||||||
messages = messages + check_sanity_sstate_dir_change(sstate_dir, sanity_data)
|
messages = messages + check_sanity_sstate_dir_change(sstate_dir, sanity_data)
|
||||||
|
|
||||||
if os.path.exists("conf") and not messages:
|
if os.path.exists("conf") and not messages:
|
||||||
f = file(sanityverfile, 'w')
|
f = file(sanityverfile, 'w')
|
||||||
f.write("SANITY_VERSION %s\n" % sanity_version)
|
f.write("SANITY_VERSION %s\n" % sanity_version)
|
||||||
@@ -614,7 +620,7 @@ def check_sanity(sanity_data):
|
|||||||
messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
|
messages = messages + "Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space."
|
||||||
|
|
||||||
if messages != "":
|
if messages != "":
|
||||||
raise_sanity_error(sanity_data.expand(messages), sanity_data)
|
raise_sanity_error(sanity_data.expand(messages), sanity_data, network_error)
|
||||||
|
|
||||||
# Create a copy of the datastore and finalise it to ensure appends and
|
# Create a copy of the datastore and finalise it to ensure appends and
|
||||||
# overrides are set - the datastore has yet to be finalised at ConfigParsed
|
# overrides are set - the datastore has yet to be finalised at ConfigParsed
|
||||||
|
|||||||
Reference in New Issue
Block a user