processutils python_exec arg cannot be None
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.concurrency |
Fix Released
|
Undecided
|
Brian Rosmaita |
Bug Description
Ran into this use case in Glance, where we may want to pass a configured path for python_exec in some cases, but otherwise want to let processutils handle it. Thus, we'd call
processutils.
where conf.python_interp could be None. On the processutiils side, the python_exec parameter is handled like this [0]:
python_exec = kwargs.
So for the glance use case, what happens is that when 'python_exec' is passed with value None, None becomes the local value of python_exec, which will not end well inside the execute() function. I can't think of an actual use case for having python_exec being None within the execute() function, so I propose that the line above be changed to:
python_exec = kwargs.
This way, if the python_exec argument is missing or is None, processutils will use an appropriate executable, which I think is most likely how people think this argument behaves anyway (I know I did).
Changed in oslo.concurrency: | |
assignee: | nobody → Brian Rosmaita (brian-rosmaita) |
Fix proposed to branch: master /review. opendev. org/c/openstack /oslo.concurren cy/+/831432
Review: https:/