Skip to content

Commit

Permalink
[IMP] upgrade_path: support upgrade paths (separated by commas)
Browse files Browse the repository at this point in the history
  • Loading branch information
royle-vietnam committed Feb 8, 2022
1 parent 0a74206 commit 831ebad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,13 @@ def load_data(cr, module_name, filename, idref=None, mode='init'):
fp = tools.file_open(pathname)
except OSError:
if tools.config.get('upgrade_path'):
pathname = os.path.join(
tools.config['upgrade_path'], module_name, filename)
fp = open(pathname)
for path in tools.config['upgrade_path'].split(','):
pathname = os.path.join(path, module_name, filename)
try:
fp = open(pathname)
break
except OSError:
pass
else:
raise

Expand Down

0 comments on commit 831ebad

Please sign in to comment.