Follow up to console port allocation

Addressed a comment in
https://review.opendev.org/#/c/706445

Change-Id: Icd7642285695e91e82e163c0bc3435b99a042a6f
Story: 2007099
Task: 38135
This commit is contained in:
Kaifeng Wang 2020-03-07 15:11:16 +08:00
parent 7a15df60c3
commit 5cb69916ce
1 changed files with 1 additions and 2 deletions

View File

@ -843,9 +843,8 @@ def _allocate_port(task):
def _release_allocated_port(task):
node = task.node
dii = node.driver_internal_info or {}
allocated_port = dii.get('allocated_ipmi_terminal_port')
allocated_port = dii.pop('allocated_ipmi_terminal_port', None)
if allocated_port:
dii.pop('allocated_ipmi_terminal_port')
node.driver_internal_info = dii
node.save()
console_utils.release_port(allocated_port)