Ticket #4983 (closed Bug: fixed)

Opened 10 years ago

PTS break if INSTANCE_HOME starts with ZOPE_HOME

Reported by: ymahe Owned by:
Priority: minor Milestone: Past
Component: General Version:
Keywords: Cc:

Description

I have INSTANCE_HOME at /home/zope/zope284i2

ZOPE_HOME at /home/zope/zope284

Zope 2.8.4 with Plone 2.1.1 refuse to start because PTS has a bug when computing the path of the .po file: it find /home/zope/zope284/2/Products/.... in place of /home/zope/zope284i2/Products/......

I have fixed it like that in PTS/utils.py :

########################################################### def make_relative_location(popath):

# return ("INSTANCE_HOME", stripped po path) # when po is located below INSTANCE_HOME # and return ("ZOPE_HOME", stripped po path) # when po is located below ZOPE_HOME

popath = os.path.normpath(popath)

instance_home = os.path.normpath(INSTANCE_HOME) zope_home = os.path.normpath(ZOPE_HOME)

if popath.startswith(zope_home):

return ("ZOPE_HOME", popath[len(zope_home)+1:])

elif popath.startswith(instance_home):

return ("INSTANCE_HOME", popath[len(instance_home)+1:])

else:

return ("ABSOLUTE", popath)

##################################################################

become

################################################################## def make_relative_location(popath):

# return ("INSTANCE_HOME", stripped po path) # when po is located below INSTANCE_HOME # and return ("ZOPE_HOME", stripped po path) # when po is located below ZOPE_HOME # ZYM fix bug

popath = os.path.normpath(popath)

instance_home = os.path.normpath(INSTANCE_HOME) + '/' zope_home = os.path.normpath(ZOPE_HOME) + '/'

if popath.startswith(zope_home):

return ("ZOPE_HOME", popath[len(zope_home):])

elif popath.startswith(instance_home):

return ("INSTANCE_HOME", popath[len(instance_home):])

else:

return ("ABSOLUTE", popath)

###############################################################

Change History

comment:1 Changed 10 years ago by hannosch

  • Status changed from new to closed
  • Resolution set to fixed

Thanks a lot for tracking this down. I have fixed this in SVN, so it will be in the next PTS and Plone version scheduled for release in about two weeks.

comment:2 Changed 3 years ago by davisagli

  • Component changed from Infrastructure to General
Note: See TracTickets for help on using tickets.