From 4c4b732f4ee931d510679129917fde5acb3bbf86 Mon Sep 17 00:00:00 2001 From: chenke Date: Wed, 4 Mar 2020 21:22:16 +0800 Subject: [PATCH] Fix minor error in extarq job The patch fix the var need_job init value to False, In some case, The None will cause some errors that are not easy to be detected. Change-Id: Ic4eac2fbc274fc5dfe9b2f4b796888b96bd78d0c Story: 2007352 Task: 38932 --- cyborg/objects/extarq/ext_arq_job.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cyborg/objects/extarq/ext_arq_job.py b/cyborg/objects/extarq/ext_arq_job.py index b22731f1..cb211401 100644 --- a/cyborg/objects/extarq/ext_arq_job.py +++ b/cyborg/objects/extarq/ext_arq_job.py @@ -33,10 +33,10 @@ class ExtARQJobMixin(object): def _bind_job(self, context, deployable): """The bind process of an acclerator.""" check_extra_job = getattr(self, "_need_extra_bind_job", None) - need_job = None + need_job = False if check_extra_job: need_job = check_extra_job(context, deployable) - if getattr(self.bind, "is_job", False) and need_job is not False: + if getattr(self.bind, "is_job", False) and need_job: LOG.info("Start job for ARQ(%s) bind.", self.arq.uuid) works = utils.ThreadWorks() job = works.spawn(self.bind, context, deployable) @@ -228,7 +228,7 @@ class ExtARQJobMixin(object): except ValueError: raise exception.InvalidParameterValue( 'Resources nummber is a invalid in' - 'device_profile_group: %s' % group) + ' device_profile_group: %s' % group) return res_type, res_num @classmethod