From b40437d19c4ff39b319ad433713f64673784d97b Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Sun, 12 Feb 2017 23:30:29 +0100 Subject: [PATCH] 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 --- pbconf/pbfilter/all.pbf | 2 +- pbconf/python-redfish.pb | 2 +- redfish-client/etc/redfish-client.conf | 2 +- redfish-client/redfish-check-cartridge | 3 +-- redfish-client/redfish-client | 2 +- setup.cfg | 4 ++-- setup.py | 6 ++++-- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pbconf/pbfilter/all.pbf b/pbconf/pbfilter/all.pbf index 1e2c6a8..637520c 100644 --- a/pbconf/pbfilter/all.pbf +++ b/pbconf/pbfilter/all.pbf @@ -66,7 +66,7 @@ filter PBURL = https://review.openstack.org/#/q/project:openstack/python-redfish filter PBLOG = yes 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 # By default build for python3 filter PBWITHPY3 = 1 diff --git a/pbconf/python-redfish.pb b/pbconf/python-redfish.pb index 308d9a7..573ed15 100644 --- a/pbconf/python-redfish.pb +++ b/pbconf/python-redfish.pb @@ -130,7 +130,7 @@ defpkgdir python-redfish = . # List of files per pkg on which to apply filters # 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 # We use pbr to generate sources diff --git a/redfish-client/etc/redfish-client.conf b/redfish-client/etc/redfish-client.conf index b00df1e..b99ae67 100644 --- a/redfish-client/etc/redfish-client.conf +++ b/redfish-client/etc/redfish-client.conf @@ -1,2 +1,2 @@ [redfish-client] -templates_path = PBTEMPLATEPATH +templates_path = PBSHAREPATH/template diff --git a/redfish-client/redfish-check-cartridge b/redfish-client/redfish-check-cartridge index 27076aa..f42dafc 100755 --- a/redfish-client/redfish-check-cartridge +++ b/redfish-client/redfish-check-cartridge @@ -222,8 +222,7 @@ if __name__ == '__main__': # Parse and manage arguments try: - usagefp = os.path.dirname(sys.argv[0]) + \ - "/redfish-check-cartridge_usage.txt" + usagefp = 'PBSHAREPATH' + "/redfish-check-cartridge_usage.txt" with open(usagefp) as usagefile: usage = usagefile.read() usagefile.close() diff --git a/redfish-client/redfish-client b/redfish-client/redfish-client index f5a7d15..700b18e 100755 --- a/redfish-client/redfish-client +++ b/redfish-client/redfish-client @@ -266,7 +266,7 @@ if __name__ == '__main__': # Parse and manage arguments try: - usagefp = os.path.dirname(sys.argv[0]) + "/redfish-client_usage.txt" + usagefp = 'PBSHAREPATH' + "/redfish-client_usage.txt" with open(usagefp) as usagefile: usage = usagefile.read() usagefile.close() diff --git a/setup.cfg b/setup.cfg index bd13d2e..f57a8f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,13 +28,13 @@ packages = scripts = redfish-client/redfish-client - redfish-client/redfish-client_usage.txt redfish-client/redfish-check-cartridge - redfish-client/redfish-check-cartridge_usage.txt [data_files_helper] conf = 'redfish-client/etc/redfish-client.conf', 'etc' 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] source-dir = doc/source diff --git a/setup.py b/setup.py index 8a6d524..5bec6e5 100755 --- a/setup.py +++ b/setup.py @@ -224,10 +224,12 @@ if('install' in sys.argv): # Update conf files for file in datafiles.data['conf']['fdst']: print('Update : {}'.format(file)) - replaceAll(file, 'PBTEMPLATEPATH', - os.path.dirname(datafiles.data['templates']['fdst'][0])) + replaceAll(file, 'PBSHAREPATH', + os.path.dirname(datafiles.data['rfcusage']['fdst'][0])) # Update script files for file in datafiles.data['script']['fdst']: print('Update : {}'.format(file)) replaceAll(file, 'PBCONFFILE', datafiles.data['conf']['fdst'][0]) replaceAll(file, 'PBVER', getversion()) + replaceAll(file, 'PBSHAREPATH', + os.path.dirname(datafiles.data['rfcusage']['fdst'][0]))