From 5235cdf4b3b7e0dabc94a2dc11ecaa63bf2f35f8 Mon Sep 17 00:00:00 2001 From: Richard Pioso Date: Fri, 4 Nov 2016 17:01:21 -0400 Subject: [PATCH] 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 --- dracclient/resources/job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracclient/resources/job.py b/dracclient/resources/job.py index e8e45d6..2961075 100644 --- a/dracclient/resources/job.py +++ b/dracclient/resources/job.py @@ -100,7 +100,7 @@ class JobManagement(object): drac_job = utils.find_xml(doc, 'DCIM_LifecycleJob', uris.DCIM_LifecycleJob) - if drac_job: + if drac_job is not None: return self._parse_drac_job(drac_job) def create_config_job(self, resource_uri, cim_creation_class_name,