Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Finding unused products

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


gaute at div

Nov 29, 2009, 2:59 AM

Post #1 of 8 (1843 views)
Permalink
Finding unused products

Quick question before I reinvent.

Is there some established way of finding products which have no
instances in zodb, and can be safely removed?

Regards

Gaute Amundsen


_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


jens at dataflake

Nov 29, 2009, 3:32 AM

Post #2 of 8 (1730 views)
Permalink
Re: Finding unused products [In reply to]

On Nov 29, 2009, at 11:59 , Gaute Amundsen wrote:

>
> Quick question before I reinvent.
>
> Is there some established way of finding products which have no
> instances in zodb, and can be safely removed?

No there isn't. You may have to invest some time writing a script that visits all objects to find out what products they belong to. It may not be worth the effort.

jens



_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


gaute at div

Nov 29, 2009, 11:23 AM

Post #3 of 8 (1718 views)
Permalink
Re: Finding unused products [In reply to]

On Sun, 2009-11-29 at 12:32 +0100, Jens Vagelpohl wrote:
> On Nov 29, 2009, at 11:59 , Gaute Amundsen wrote:
>
> >
> > Quick question before I reinvent.
> >
> > Is there some established way of finding products which have no
> > instances in zodb, and can be safely removed?
>
> No there isn't. You may have to invest some time writing a script that
> visits all objects to find out what products they belong to. It may
> not be worth the effort.
>
> jens

Unfortunately it has "not been worth the effort" for a number of years,
but now it has become unavoidable.
Walking the tree it is then.

Gaute



_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


tseaver at palladion

Nov 29, 2009, 1:05 PM

Post #4 of 8 (1726 views)
Permalink
Re: Finding unused products [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gaute Amundsen wrote:
> On Sun, 2009-11-29 at 12:32 +0100, Jens Vagelpohl wrote:
>> On Nov 29, 2009, at 11:59 , Gaute Amundsen wrote:
>>
>>> Quick question before I reinvent.
>>>
>>> Is there some established way of finding products which have no
>>> instances in zodb, and can be safely removed?
>> No there isn't. You may have to invest some time writing a script that
>> visits all objects to find out what products they belong to. It may
>> not be worth the effort.
>>
>> jens
>
> Unfortunately it has "not been worth the effort" for a number of years,
> but now it has become unavoidable.
> Walking the tree it is then.

You could probably work directly with the pickles way faster than
activating every object in a large site: look at the 'fsdump' script
for clues.



Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksS4f0ACgkQ+gerLs4ltQ5s0wCfdk8Ru7uHUI7Fj7OGjDfcyAla
724An0ZOhZ2qorejVAwUzK2OdhFdPfYv
=quZ0
-----END PGP SIGNATURE-----

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


gaute at div

Nov 30, 2009, 12:38 AM

Post #5 of 8 (1711 views)
Permalink
Re: Finding unused products [In reply to]

On Sun, 2009-11-29 at 16:05 -0500, Tres Seaver wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gaute Amundsen wrote:
> > On Sun, 2009-11-29 at 12:32 +0100, Jens Vagelpohl wrote:
> >> On Nov 29, 2009, at 11:59 , Gaute Amundsen wrote:
> >>
> >>> Quick question before I reinvent.
> >>>
> >>> Is there some established way of finding products which have no
> >>> instances in zodb, and can be safely removed?
> >> No there isn't. You may have to invest some time writing a script that
> >> visits all objects to find out what products they belong to. It may
> >> not be worth the effort.
> >>
> >> jens
> >
> > Unfortunately it has "not been worth the effort" for a number of years,
> > but now it has become unavoidable.
> > Walking the tree it is then.
>
> You could probably work directly with the pickles way faster than
> activating every object in a large site: look at the 'fsdump' script
> for clues.
> Tres.

Thanks for the tip, but testing a few tings now, it seems I would
probably spend way more time on the learning-curve than I'd save in
parsing.

I think, I'll rather stick my expensive parse results i a table, and
work from that.

Unless you think otherwise and can point me towards how to get both the
path, and the metatype out of that pickle. :-)

Gaute



_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


tseaver at palladion

Nov 30, 2009, 7:59 AM

Post #6 of 8 (1706 views)
Permalink
Re: Finding unused products [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gaute Amundsen wrote:
> On Sun, 2009-11-29 at 16:05 -0500, Tres Seaver wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Gaute Amundsen wrote:
>>> On Sun, 2009-11-29 at 12:32 +0100, Jens Vagelpohl wrote:
>>>> On Nov 29, 2009, at 11:59 , Gaute Amundsen wrote:
>>>>
>>>>> Quick question before I reinvent.
>>>>>
>>>>> Is there some established way of finding products which have no
>>>>> instances in zodb, and can be safely removed?
>>>> No there isn't. You may have to invest some time writing a script that
>>>> visits all objects to find out what products they belong to. It may
>>>> not be worth the effort.
>>>>
>>>> jens
>>> Unfortunately it has "not been worth the effort" for a number of years,
>>> but now it has become unavoidable.
>>> Walking the tree it is then.
>> You could probably work directly with the pickles way faster than
>> activating every object in a large site: look at the 'fsdump' script
>> for clues.
>> Tres.
>
> Thanks for the tip, but testing a few tings now, it seems I would
> probably spend way more time on the learning-curve than I'd save in
> parsing.
>
> I think, I'll rather stick my expensive parse results i a table, and
> work from that.
>
> Unless you think otherwise and can point me towards how to get both the
> path, and the metatype out of that pickle. :-)

The pickle holds the dotted name of the instance class, which should be
a clue. ;)


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksT698ACgkQ+gerLs4ltQ6GvQCfYOLjuWon0Od6M6l2UB5MedzB
1akAnRKkky89t0G0BEgDjXdbIJIGBeBO
=fGcz
-----END PGP SIGNATURE-----

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


dev101 at magma

Nov 30, 2009, 8:43 AM

Post #7 of 8 (1711 views)
Permalink
Re: Finding unused products [In reply to]

----- Original Message -----
From: "Tres Seaver" <tseaver [at] palladion>
To: <zope [at] zope>
Sent: Sunday, November 29, 2009 4:05 PM
Subject: Re: [Zope] Finding unused products


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gaute Amundsen wrote:
>> On Sun, 2009-11-29 at 12:32 +0100, Jens Vagelpohl wrote:
>>> On Nov 29, 2009, at 11:59 , Gaute Amundsen wrote:
>>>
>>>> Quick question before I reinvent.
>>>>
>>>> Is there some established way of finding products which have no
>>>> instances in zodb, and can be safely removed?
>>> No there isn't. You may have to invest some time writing a script that
>>> visits all objects to find out what products they belong to. It may
>>> not be worth the effort.
>>>
>>> jens
>>
>> Unfortunately it has "not been worth the effort" for a number of years,
>> but now it has become unavoidable.
>> Walking the tree it is then.
>
> You could probably work directly with the pickles way faster than
> activating every object in a large site: look at the 'fsdump' script
> for clues.

You could also write a stand-alone python routine to access the zodb (.fs
file) directly (should be faster than running a script through a running
zope instance and maybe easier than working with pickles).

Jonathan

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


gaute at div

Nov 30, 2009, 11:56 PM

Post #8 of 8 (1693 views)
Permalink
Re: Finding unused products [In reply to]

On Mon, 2009-11-30 at 10:59 -0500, Tres Seaver wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gaute Amundsen wrote:
> > On Sun, 2009-11-29 at 16:05 -0500, Tres Seaver wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Gaute Amundsen wrote:
> >>> On Sun, 2009-11-29 at 12:32 +0100, Jens Vagelpohl wrote:
> >>>> On Nov 29, 2009, at 11:59 , Gaute Amundsen wrote:
> >>>>
> >>>>> Quick question before I reinvent.
> >>>>>
> >>>>> Is there some established way of finding products which have no
> >>>>> instances in zodb, and can be safely removed?
> >>>> No there isn't. You may have to invest some time writing a script that
> >>>> visits all objects to find out what products they belong to. It may
> >>>> not be worth the effort.
> >>>>
> >>>> jens
> >>> Unfortunately it has "not been worth the effort" for a number of years,
> >>> but now it has become unavoidable.
> >>> Walking the tree it is then.
> >> You could probably work directly with the pickles way faster than
> >> activating every object in a large site: look at the 'fsdump' script
> >> for clues.
> >> Tres.
> >
> > Thanks for the tip, but testing a few tings now, it seems I would
> > probably spend way more time on the learning-curve than I'd save in
> > parsing.
> >
> > I think, I'll rather stick my expensive parse results i a table, and
> > work from that.
> >
> > Unless you think otherwise and can point me towards how to get both the
> > path, and the metatype out of that pickle. :-)
>
> The pickle holds the dotted name of the instance class, which should be
> a clue. ;)

I spotted that playing around with fsdump yes.

On second thought I guess my hidden assumption was that
context.all_meta_types() would give me the best list of installed
products to compare against, and thus I would need the actual meta_type
string.

On examining the results of the first run of my db-based script, I'm not
so sure. It's after all just some strings..
Perhaps I ought to rephrase that as a question :)

Can I rely on context.all_meta_types() being complete, or could a
product have installed objects that would not be in that list?

Is there some other, more reliable way to link an object to it's
product?

Gaute





_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.