Products have incorrect "home" attribute
After migrating to a new server, several of my Zope products have an incorrect "home" attribute that specifies where they live on the filesystem. However, when I try to change these attributes using an external method, the attributes do not change. Any help? Peace, George
--On 18. Januar 2006 01:24:34 -0500 George Lee <georgeleejr@gmail.com> wrote:
After migrating to a new server, several of my Zope products have an incorrect "home" attribute that specifies where they live on the filesystem.
What and where is the 'home' attribute????? -aj
George Lee wrote:
After migrating to a new server, several of my Zope products have an incorrect "home" attribute that specifies where they live on the filesystem. However, when I try to change these attributes using an external method, the attributes do not change. Any help?
Peace, George
I dunno if this relates to your specific case (and apologies for perhaps stating the obvious). Did you delete the *.pyc files after moving the products? pyc files contain information about their paths, and they do not get recompiled if their source file is unchanged. hth, /dario -- -- ------------------------------------------------------------------- Dario Lopez-Kästen, IT Systems & Services Chalmers University of Tech. Lyrics applied to programming & application design: "emancipate yourself from mental slavery" - redemption song, b. marley
After migrating to a new server, several of my Zope products have an incorrect "home" attribute that specifies where they live on the filesystem. However, when I try to change these attributes using an external method, the attributes do not change. Any help?
Peace, George
Turns out it was a bug in my external method, writing == instead of =, that tripped me up. This is the external method I used: OLD_INSTANCE_PROD_DIR_LIST = [ '/home/BLUH1/zope/instance1/Products/', '/home/BLUH2/zope/instance1/Products/', ] NEW_INSTANCE_PROD_DIR = '/usr/local/zope/instance1/Products/' OLD_PYTHON_PROD_DIR_LIST = [ '/usr/home/BLUH3/zope/270/lib/python/Products/', '/home/BLUH4/zope/273/lib/python/Products/', '/home/BLUH5/zope/281/lib/python/Products/', ] NEW_PYTHON_PROD_DIR = '/usr/local/zope/284/lib/python/Products/' def listHome(self): prods = self.Control_Panel.Products listBefore = [] listAfter = [] for p in prods.objectIds(): homeBefore = prods._getOb(p).home listBefore = listBefore + [homeBefore] if homeBefore in map( lambda x : x + p, OLD_INSTANCE_PROD_DIR_LIST ): prods._getOb(p).home = NEW_INSTANCE_PROD_DIR + p elif homeBefore in map( lambda x : x + p, OLD_PYTHON_PROD_DIR_LIST ): prods._getOb(p).home = NEW_PYTHON_PROD_DIR + p listAfter = listAfter + [prods._getOb(p).home] return "Before: %s\n\nAfter: %s" % (str(listBefore),str(listAfter))
participants (3)
-
Andreas Jung -
Dario Lopez-Kästen -
George Lee