Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Joshua Lock <josh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/1] classes/sanity: enhance the network connectivity test
Date: Thu, 25 Aug 2011 08:29:30 -0700	[thread overview]
Message-ID: <452876f08ee6516713d5a7198e8589953cd35f4b.1314286007.git.josh@linux.intel.com> (raw)
In-Reply-To: <cover.1314286007.git.josh@linux.intel.com>
In-Reply-To: <cover.1314286007.git.josh@linux.intel.com>

Switch to use the checkstatus fetcher API for the network connectivity test,
this has several advantages:
* we no longer print any messages to the console whilst the check is
being run
* we don't actually download anything, removing the need for tidy up and
making the code more concise

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 meta/classes/sanity.bbclass |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 16af029..cefe6a4 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -95,15 +95,9 @@ def check_connectivity(d):
     network_enabled = not bb.data.getVar('BB_NO_NETWORK', d, True)
     check_enabled = len(test_uris)
     if check_enabled and network_enabled:
-        data = bb.data.createCopy(d)
-        bookmark = os.getcwd()
-        dldir = bb.data.expand('${TMPDIR}/sanity', data)
-        bb.data.setVar('DL_DIR', dldir, data)
-
         try:
-            fetcher = bb.fetch2.Fetch(test_uris, data)
-            fetcher.download()
-            fetcher.clean(test_uris)
+            fetcher = bb.fetch2.Fetch(test_uris, d)
+            fetcher.checkstatus()
         except Exception:
             # Allow the message to be configured so that users can be
             # pointed to a support mechanism.
@@ -111,10 +105,6 @@ def check_connectivity(d):
             if len(msg) == 0:
                 msg = "Failed to fetch test data from the network. Please ensure your network is configured correctly.\n"
             retval = msg
-        finally:
-            # Make sure we tidy up the cruft
-            oe.path.remove(dldir)
-            os.chdir(bookmark)
 
     return retval
 
-- 
1.7.6




  reply	other threads:[~2011-08-25 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 15:29 [PATCH 0/1] Enhance network connectivity sanity check Joshua Lock
2011-08-25 15:29 ` Joshua Lock [this message]
2011-08-25 15:50   ` [PATCH 1/1] classes/sanity: enhance the network connectivity test Richard Purdie

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=452876f08ee6516713d5a7198e8589953cd35f4b.1314286007.git.josh@linux.intel.com \
    --to=josh@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox