JobManagement.get_job() causes FutureWarning

The python-dracclient job resource's JobManagement.get_job() causes a
FutureWarning. When that function is called, the following is output.

/usr/lib/python2.7/site-packages/dracclient/resources/job.py:103:
FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.
  if drac_job:

Change the identified line as suggested by the warning.

Change-Id: I9624b76cbf2e195f387ba104c98ae922619aa1f2
Closes-Bug: #1639339
This commit is contained in:
Richard Pioso 2016-11-04 17:01:21 -04:00
parent 0b4855c465
commit 5235cdf4b3
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ class JobManagement(object):
drac_job = utils.find_xml(doc, 'DCIM_LifecycleJob', drac_job = utils.find_xml(doc, 'DCIM_LifecycleJob',
uris.DCIM_LifecycleJob) uris.DCIM_LifecycleJob)
if drac_job: if drac_job is not None:
return self._parse_drac_job(drac_job) return self._parse_drac_job(drac_job)
def create_config_job(self, resource_uri, cim_creation_class_name, def create_config_job(self, resource_uri, cim_creation_class_name,