utils.version module

utils.version.SPTuple

alias of StreamProductTuple

class utils.version.Version(vstring)[source]

Bases: object

Version class based on distutil.version.LooseVersion

component_re = <_sre.SRE_Pattern object at 0x7f4d27515348>
is_in_series(series)[source]

This method checks whether the version belongs to another version’s series.

Eg.: Version("5.2.5.2").is_in_series("5.2") returns True

Parameters:series – Another Version to check against. If string provided, will be converted to Version
classmethod latest()[source]
classmethod lowest()[source]
parse(vstring)[source]
product_version()[source]
series(n=2)[source]
stream()[source]
utils.version.appliance_build_date()[source]
utils.version.appliance_build_datetime()[source]
utils.version.appliance_has_netapp()[source]
utils.version.appliance_is_downstream()[source]
utils.version.before_date_or_version(date=None, version=None)[source]

Function for deciding based on the build date and version.

Usage:

* If both date and version are set, then two things can happen. If the appliance is
    downstream, both date and version are checked, otherwise only the date.
* If only date is set, then only date is checked.
* if only version is set, then it checks the version if the appliance is downstream,
    otherwise it returns ``False``

The checks are in form appliance_build_date() < date and current_version() < version. Therefore when used in if statement, the truthy value signalizes ‘older’ version and falsy signalizes ‘newer’ version.

utils.version.current_stream()[source]
utils.version.current_version()[source]

A lazy cached method to return the appliance version.

Do not catch errors, since generally we cannot proceed with testing, without knowing the server version.

utils.version.dependent(default_function)[source]
utils.version.get_product_version(ver)[source]

Return product version for given Version obj or version string

utils.version.get_stream(ver)[source]

Return a stream name for given Version obj or version string

utils.version.get_version(obj=None)[source]

Return a Version based on obj. For CFME, ‘master’ version means always the latest (compares as greater than any other version)

If obj is None, the version will be retrieved from the current appliance

utils.version.parsedate(o)[source]
utils.version.pick(v_dict)[source]

Collapses an ambiguous series of objects bound to specific versions by interrogating the CFME Version and returning the correct item.

utils.version.product_version_dispatch(*_args, **_kwargs)[source]

Dispatch function for use in multimethods that just ignores arguments and dispatches on the current product version.

utils.version.since_date_or_version(*args, **kwargs)[source]

Opposite of before_date_or_version()