Remove generate_driver_list dependency on cur dir
tools/generate_driver_list.py assumes that the current directory is the Cinder root directory. If the script is run from a different directory, it doesn't generate the driver info. This patch changes the current directory to the root directory before calling the utility functions to generate the driver list. Closes-bug: #1604269 Change-Id: I35829003868531ccd76ee26e83e0b51067984a6a
This commit is contained in:
parent
5c40bf9225
commit
71cf291cf2
@ -14,6 +14,8 @@
|
||||
|
||||
"""Generate list of cinder drivers"""
|
||||
|
||||
import os
|
||||
|
||||
from cinder.interface import util
|
||||
|
||||
|
||||
@ -39,18 +41,25 @@ def print_drivers(drivers, config_name):
|
||||
|
||||
|
||||
def main():
|
||||
print('VOLUME DRIVERS')
|
||||
print('==============')
|
||||
print_drivers(util.get_volume_drivers(), 'volume_driver')
|
||||
tools_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
cinder_root = os.path.dirname(tools_dir)
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(cinder_root)
|
||||
|
||||
print('BACKUP DRIVERS')
|
||||
print('==============')
|
||||
print_drivers(util.get_backup_drivers(), 'backup_driver')
|
||||
try:
|
||||
print('VOLUME DRIVERS')
|
||||
print('==============')
|
||||
print_drivers(util.get_volume_drivers(), 'volume_driver')
|
||||
|
||||
print('FC ZONE MANAGER DRIVERS')
|
||||
print('=======================')
|
||||
print_drivers(util.get_fczm_drivers(), 'zone_driver')
|
||||
print('BACKUP DRIVERS')
|
||||
print('==============')
|
||||
print_drivers(util.get_backup_drivers(), 'backup_driver')
|
||||
|
||||
print('FC ZONE MANAGER DRIVERS')
|
||||
print('=======================')
|
||||
print_drivers(util.get_fczm_drivers(), 'zone_driver')
|
||||
finally:
|
||||
os.chdir(cur_dir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user