Skip to content

Commit

Permalink
chore(src): Address xml deprecation working (#210)
Browse files Browse the repository at this point in the history
DeprecationWarning: Testing an element's truth value will raise an exception in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  if (host_sec):
  • Loading branch information
aleasto authored Oct 3, 2024
1 parent cc44946 commit 1a532e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wsdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def update(self, xml_str: str, xaddr: str, interface: NetworkInterface) -> None:
elif dialect == WSDP_URI + '/Relationship':
host_xpath = 'wsdp:Relationship[@Type="{}/host"]/wsdp:Host'.format(WSDP_URI)
host_sec = section.find(host_xpath, namespaces)
if (host_sec):
if (host_sec is not None):
self.extract_host_props(host_sec)
else:
logger.debug('unknown metadata dialect ({})'.format(dialect))
Expand Down

0 comments on commit 1a532e3

Please sign in to comment.