Fix TypeError of _get_project_id when project_id is None
If we get flavors with a domain token or an unscope token,
the project id of this case is None, will raise "TypeError:
'in <string>' requires string as left operand, not NoneType"
in _get_project_id. So, first we need check whether project_id
is None or not.
We can just return '' if project_id is None.
Change-Id: I8477d08a956a5b0262bd473254d9202738b6b65b
Closes-Bug: #1733746
(cherry picked from commit 036a692565ef0f1c730f28ea083465fad9dc3b13)
Reviewed: https:/ /review. openstack. org/524687 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=781a963c58a 7bb84077de7c305 6d148afae0d303
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit 781a963c58a7bb8 4077de7c3056d14 8afae0d303
Author: Yikun Jiang <email address hidden>
Date: Tue Nov 21 22:21:12 2017 -0500
Fix TypeError of _get_project_id when project_id is None
If we get flavors with a domain token or an unscope token,
the project id of this case is None, will raise "TypeError:
'in <string>' requires string as left operand, not NoneType"
in _get_project_id. So, first we need check whether project_id
is None or not.
We can just return '' if project_id is None.
Change-Id: I8477d08a956a5b 0262bd473254d92 02738b6b65b c730f28ea083465 fad9dc3b13)
Closes-Bug: #1733746
(cherry picked from commit 036a692565ef0f1