On Wed, 2021-02-10 at 10:46 +0800, Yu, Mingli wrote:
> From: Mingli Yu <mingli...@windriver.com>
> 
> The network connectivity check via checking www.example.com by default
> and also can customized by CONNECTIVITY_CHECK_URIS if desired.
> 
> Improve the check message to let the user know if the network is actually
> unaccessible or the checked URIs is wrongly set.
> 
> [YOCTO #12708]
> 
> Signed-off-by: Mingli Yu <mingli...@windriver.com>
> ---
>  meta/classes/sanity.bbclass | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 485173ab48..ebf0a559a2 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -389,13 +389,17 @@ def check_connectivity(d):
>          except Exception as err:
>              # Allow the message to be configured so that users can be
>              # pointed to a support mechanism.
> +            urlmsg = "Check network connectivity via the below tested URIs\n"
> +            urlmsg += "    please make sure the below tested URIs 
> accessible\n"
> +            for test_uri in test_uris:
> +                urlmsg = "    %s\n" % test_uri.strip()
>              msg = data.getVar('CONNECTIVITY_CHECK_MSG') or ""
>              if len(msg) == 0:
>                  msg = "%s.\n" % err
>                  msg += "    Please ensure your host's network is configured 
> correctly,\n"
>                  msg += "    or set BB_NO_NETWORK = \"1\" to disable network 
> access if\n"
>                  msg += "    all required sources are on local disk.\n"
> -            retval = msg
> +            retval = urlmsg + msg
>  
> 


The idea was to allow things like toaster as a UI to override the
message entirely so this should probably just add to the len(msg) == 0
case. Probably something like:

if not msg:
    msg = "%s.\n" % err
    msg += "    Please ensure your host's network is configured correctly,\n"
    msg += "    or set BB_NO_NETWORK = \"1\" to disable network access if\n"
    msg += "    all required sources are on local disk.\n"
    msg += "    The urls tested were:
    for test_uri in test_uris:
        msg += "        %s\n" % test_uri.strip()

len(msg) == 0 is a horrible test so I tweaked that too :)

Cheers,

Richard




-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#147948): 
https://lists.openembedded.org/g/openembedded-core/message/147948
Mute This Topic: https://lists.openembedded.org/mt/80523455/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to