Correct the relative path calculation

I'm not sure what I was thinking, but the code is clearly wrong now.

Change-Id: Icf17b8e9181dbb387fd65ae141d43749309fd0b4
This commit is contained in:
Dmitry Tantsur 2019-08-28 13:32:35 +02:00
parent 18d161bdc3
commit e3e43601d2
1 changed files with 6 additions and 2 deletions

View File

@ -18,8 +18,12 @@ import sys
LOCATIONS = [
os.path.abspath('.'),
# This accounts for pip installations on Ubuntu that go into /usr/local
os.path.abspath(os.path.basename(sys.argv[0])),
# This accounts for pip installations on Ubuntu that go into /usr/local.
# This logic converts e.g. /usr/local/bin/ironic-python-agent-builder
# into /usr/local/share/ironic-python-agent-builder.
os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),
'..', 'share',
'ironic-python-agent-builder')),
# This accounts for system-wide installations to /usr
os.path.join(sys.prefix, 'share', 'ironic-python-agent-builder'),
]