All of lore.kernel.org
 help / color / mirror / Atom feed
* [[PATCH][layerindex]] layerindex: Update tinfoil to call shutdown method
@ 2017-01-05 21:21 Aníbal Limón
  2017-01-11  8:59 ` Paul Eggleton
  0 siblings, 1 reply; 4+ messages in thread
From: Aníbal Limón @ 2017-01-05 21:21 UTC (permalink / raw)
  To: yocto; +Cc: paul.eggleton

The new client/server API of tinfoil requires explicit call of
shutdown method to send the event for finalize cooker process.

Also in update_layer remove the databuilder and cache instance
now isn't needed.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
 layerindex/bulkchange.py           | 1 +
 layerindex/recipedesc.py           | 2 ++
 layerindex/recipeparse.py          | 6 ------
 layerindex/tools/import_classic.py | 1 +
 layerindex/update_layer.py         | 1 +
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/layerindex/bulkchange.py b/layerindex/bulkchange.py
index 8102571..e32fae6 100644
--- a/layerindex/bulkchange.py
+++ b/layerindex/bulkchange.py
@@ -231,6 +231,7 @@ def main():
 
         outp = generate_patches(tinfoil, fetchdir, changeset, sys.argv[2])
     finally:
+        tinfoil.shutdown()
         utils.unlock_file(lockfile)
 
     if outp:
diff --git a/layerindex/recipedesc.py b/layerindex/recipedesc.py
index 43376cf..989988a 100644
--- a/layerindex/recipedesc.py
+++ b/layerindex/recipedesc.py
@@ -89,6 +89,8 @@ def main():
             except Exception as e:
                 logger.info("Unable to read %s: %s", fullpath, str(e))
 
+    tinfoil.shutdown()
+
     sys.exit(0)
 
 
diff --git a/layerindex/recipeparse.py b/layerindex/recipeparse.py
index 26c61aa..9cfd65c 100644
--- a/layerindex/recipeparse.py
+++ b/layerindex/recipeparse.py
@@ -34,12 +34,6 @@ def _setup_tinfoil(bitbakepath, enable_tracking):
             tinfoil.cooker.enableDataTracking()
     tinfoil.prepare(config_only = True)
 
-    # XXX: Setup databuilder
-    tinfoil.databuilder = bb.cookerdata.CookerDataBuilder(tinfoil.config)
-    tinfoil.databuilder.parseBaseConfiguration()
-
-    tinfoil.cache = bb.cache.NoCache(tinfoil.databuilder)
-
     return tinfoil
 
 def _parse_layer_conf(layerdir, data):
diff --git a/layerindex/tools/import_classic.py b/layerindex/tools/import_classic.py
index 45ccaa9..085401c 100755
--- a/layerindex/tools/import_classic.py
+++ b/layerindex/tools/import_classic.py
@@ -201,6 +201,7 @@ def main():
         transaction.rollback()
     finally:
         transaction.leave_transaction_management()
+        tinfoil.shutdown()
 
     shutil.rmtree(tempdir)
     sys.exit(0)
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index 13b508f..58050f9 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -611,6 +611,7 @@ def main():
         import traceback
         traceback.print_exc()
 
+    tinfoil.shutdown()
     shutil.rmtree(tempdir)
     sys.exit(0)
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [[PATCH][layerindex]] layerindex: Update tinfoil to call shutdown method
  2017-01-05 21:21 [[PATCH][layerindex]] layerindex: Update tinfoil to call shutdown method Aníbal Limón
@ 2017-01-11  8:59 ` Paul Eggleton
  2017-01-11 14:42   ` Aníbal Limón
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggleton @ 2017-01-11  8:59 UTC (permalink / raw)
  To: Aníbal Limón; +Cc: yocto

Hi Aníbal,

On Thu, 05 Jan 2017 15:21:36 Aníbal Limón wrote:
> The new client/server API of tinfoil requires explicit call of
> shutdown method to send the event for finalize cooker process.
> 
> Also in update_layer remove the databuilder and cache instance
> now isn't needed.

This patch didn't apply against master - the databuilder piece does not appear 
to be there.

Since it was a simple patch, I've remade the changes (with most of your commit 
message) and pushed it to the paule/django18 branch that hopefully we'll be 
moving over to soon.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [[PATCH][layerindex]] layerindex: Update tinfoil to call shutdown method
  2017-01-11  8:59 ` Paul Eggleton
@ 2017-01-11 14:42   ` Aníbal Limón
  2017-01-11 19:21     ` Paul Eggleton
  0 siblings, 1 reply; 4+ messages in thread
From: Aníbal Limón @ 2017-01-11 14:42 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]



On 01/11/2017 02:59 AM, Paul Eggleton wrote:
> Hi Aníbal,
> 
> On Thu, 05 Jan 2017 15:21:36 Aníbal Limón wrote:
>> The new client/server API of tinfoil requires explicit call of
>> shutdown method to send the event for finalize cooker process.
>>
>> Also in update_layer remove the databuilder and cache instance
>> now isn't needed.
> 
> This patch didn't apply against master - the databuilder piece does not appear 
> to be there.

Great may be was my own changes against RRS,

Only a comment if your layerindex scripts don't call shutdown the update
script seems blocked because never arrives the event.

Cheers,
	alimon
> 
> Since it was a simple patch, I've remade the changes (with most of your commit 
> message) and pushed it to the paule/django18 branch that hopefully we'll be 
> moving over to soon.
> 
> Cheers,
> Paul
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [[PATCH][layerindex]] layerindex: Update tinfoil to call shutdown method
  2017-01-11 14:42   ` Aníbal Limón
@ 2017-01-11 19:21     ` Paul Eggleton
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2017-01-11 19:21 UTC (permalink / raw)
  To: Aníbal Limón; +Cc: yocto

On Wed, 11 Jan 2017 08:42:46 Aníbal Limón wrote:
> On 01/11/2017 02:59 AM, Paul Eggleton wrote:
> > On Thu, 05 Jan 2017 15:21:36 Aníbal Limón wrote:
> >> The new client/server API of tinfoil requires explicit call of
> >> shutdown method to send the event for finalize cooker process.
> >> 
> >> Also in update_layer remove the databuilder and cache instance
> >> now isn't needed.
> > 
> > This patch didn't apply against master - the databuilder piece does not
> > appear to be there.
> 
> Great may be was my own changes against RRS,
> 
> Only a comment if your layerindex scripts don't call shutdown the update
> script seems blocked because never arrives the event.

On the paule/django18 branch the update_layer.py script already calls 
shutdown(), and your patch takes care of the rest.

However this seems like a bug to me - if the client neglects to call 
shutdown() it would be nice if it didn't break things. Earlier I did use a 
destructor within the Tinfoil class to call shutdown() if it hadn't already 
been called, but I don't think that's reliable.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-11 19:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05 21:21 [[PATCH][layerindex]] layerindex: Update tinfoil to call shutdown method Aníbal Limón
2017-01-11  8:59 ` Paul Eggleton
2017-01-11 14:42   ` Aníbal Limón
2017-01-11 19:21     ` Paul Eggleton

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.