Fix wrong delivery for usage files

- usage files are now placed under /usr/share (PBSHAREPATH variable) and not
  /usr/bin with the binary.
- PBTEMPLATEPATH replaced by PBSHAREPATH/templates

Change-Id: I757c679bf03e4e93028e019086ad665e2d43b35b
This commit is contained in:
Bruno Cornec 2017-02-12 23:30:29 +01:00
parent b242bb8294
commit b40437d19c
7 changed files with 11 additions and 10 deletions

View File

@ -66,7 +66,7 @@ filter PBURL = https://review.openstack.org/#/q/project:openstack/python-redfish
filter PBLOG = yes filter PBLOG = yes
filter PBCONFFILE = /etc/redfish-client.conf filter PBCONFFILE = /etc/redfish-client.conf
filter PBTEMPLATEPATH = /usr/share/redfish-client/templates filter PBSHAREPATH = /usr/share/redfish-client
filter PBPYTHON3FILTER = perl -pi -e "s|configparser>=3.3.0; python_version < '3'|configparser>=3.3.0|" requirements.txt filter PBPYTHON3FILTER = perl -pi -e "s|configparser>=3.3.0; python_version < '3'|configparser>=3.3.0|" requirements.txt
# By default build for python3 # By default build for python3
filter PBWITHPY3 = 1 filter PBWITHPY3 = 1

View File

@ -130,7 +130,7 @@ defpkgdir python-redfish = .
# List of files per pkg on which to apply filters # List of files per pkg on which to apply filters
# Files are mentioned relatively to pbroot/defpkgdir # Files are mentioned relatively to pbroot/defpkgdir
filteredfiles python-redfish = redfish-client/redfish-client,doc/source/conf.py,redfish-client/etc/redfish-client.conf,install.sh filteredfiles python-redfish = redfish-client/redfish-client,doc/source/conf.py,redfish-client/etc/redfish-client.conf,install.sh,redfish-client/redfish-check-cartridge
#supfiles python-redfish = python-redfish.init #supfiles python-redfish = python-redfish.init
# We use pbr to generate sources # We use pbr to generate sources

View File

@ -1,2 +1,2 @@
[redfish-client] [redfish-client]
templates_path = PBTEMPLATEPATH templates_path = PBSHAREPATH/template

View File

@ -222,8 +222,7 @@ if __name__ == '__main__':
# Parse and manage arguments # Parse and manage arguments
try: try:
usagefp = os.path.dirname(sys.argv[0]) + \ usagefp = 'PBSHAREPATH' + "/redfish-check-cartridge_usage.txt"
"/redfish-check-cartridge_usage.txt"
with open(usagefp) as usagefile: with open(usagefp) as usagefile:
usage = usagefile.read() usage = usagefile.read()
usagefile.close() usagefile.close()

View File

@ -266,7 +266,7 @@ if __name__ == '__main__':
# Parse and manage arguments # Parse and manage arguments
try: try:
usagefp = os.path.dirname(sys.argv[0]) + "/redfish-client_usage.txt" usagefp = 'PBSHAREPATH' + "/redfish-client_usage.txt"
with open(usagefp) as usagefile: with open(usagefp) as usagefile:
usage = usagefile.read() usage = usagefile.read()
usagefile.close() usagefile.close()

View File

@ -28,13 +28,13 @@ packages =
scripts = scripts =
redfish-client/redfish-client redfish-client/redfish-client
redfish-client/redfish-client_usage.txt
redfish-client/redfish-check-cartridge redfish-client/redfish-check-cartridge
redfish-client/redfish-check-cartridge_usage.txt
[data_files_helper] [data_files_helper]
conf = 'redfish-client/etc/redfish-client.conf', 'etc' conf = 'redfish-client/etc/redfish-client.conf', 'etc'
templates = 'redfish-client/templates/*', 'share/redfish-client/templates' templates = 'redfish-client/templates/*', 'share/redfish-client/templates'
rfcusage = 'redfish-client/redfish-client_usage.txt', 'share/redfish-client/'
rccusage = 'redfish-client/redfish-check-cartridge_usage.txt', 'share/redfish-client/'
[build_sphinx] [build_sphinx]
source-dir = doc/source source-dir = doc/source

View File

@ -224,10 +224,12 @@ if('install' in sys.argv):
# Update conf files # Update conf files
for file in datafiles.data['conf']['fdst']: for file in datafiles.data['conf']['fdst']:
print('Update : {}'.format(file)) print('Update : {}'.format(file))
replaceAll(file, 'PBTEMPLATEPATH', replaceAll(file, 'PBSHAREPATH',
os.path.dirname(datafiles.data['templates']['fdst'][0])) os.path.dirname(datafiles.data['rfcusage']['fdst'][0]))
# Update script files # Update script files
for file in datafiles.data['script']['fdst']: for file in datafiles.data['script']['fdst']:
print('Update : {}'.format(file)) print('Update : {}'.format(file))
replaceAll(file, 'PBCONFFILE', datafiles.data['conf']['fdst'][0]) replaceAll(file, 'PBCONFFILE', datafiles.data['conf']['fdst'][0])
replaceAll(file, 'PBVER', getversion()) replaceAll(file, 'PBVER', getversion())
replaceAll(file, 'PBSHAREPATH',
os.path.dirname(datafiles.data['rfcusage']['fdst'][0]))