libcloud.utils.xml module

libcloud.utils.xml.findall(element, xpath, namespace=None)[source]
libcloud.utils.xml.findall_ignore_namespace(element, xpath, namespace=None)[source]

Special version of findall() which first tries to find the provided value using the provided namespace and in case no results are found we fallback to the xpath lookup without namespace.

This is needed because some providers return some responses with namespace and some without.

libcloud.utils.xml.findattr(element, xpath, namespace=None)[source]
libcloud.utils.xml.findtext(element, xpath, namespace=None, no_text_value='')[source]
Parameters:

no_text_value (object) – Value to return if the provided element has no text value.

libcloud.utils.xml.findtext_ignore_namespace(element, xpath, namespace=None, no_text_value='')[source]

Special version of findtext() which first tries to find the provided value using the provided namespace and in case no results are found we fallback to the xpath lookup without namespace.

This is needed because some providers return some responses with namespace and some without.

libcloud.utils.xml.fixxpath(xpath, namespace=None)[source]