All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard Purdie" <richard.purdie@linuxfoundation.org>
To: "Yu, Mingli" <mingli.yu@windriver.com>,
	 openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] sanity.bbclass: improve the network connectivity check message
Date: Thu, 11 Feb 2021 12:55:52 +0000	[thread overview]
Message-ID: <cfb3d3d350ec28062fccfa432e2bae4507641b34.camel@linuxfoundation.org> (raw)
In-Reply-To: <20210210024639.1033-1-mingli.yu@windriver.com>

On Wed, 2021-02-10 at 10:46 +0800, Yu, Mingli wrote:
> From: Mingli Yu <mingli.yu@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.yu@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





      reply	other threads:[~2021-02-11 12:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  2:46 [PATCH] sanity.bbclass: improve the network connectivity check message Yu, Mingli
2021-02-11 12:55 ` Richard Purdie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfb3d3d350ec28062fccfa432e2bae4507641b34.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=mingli.yu@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.