Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python3.6 /
site-packages /
salt /
utils /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
decorators
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
dockermod
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
openstack
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
pkg
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
validate
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
237
B
-rw-r--r--
2022-05-16 09:16
aggregation.py
5.17
KB
-rw-r--r--
2022-05-16 09:16
args.py
19.86
KB
-rw-r--r--
2022-05-16 09:16
asynchronous.py
4.07
KB
-rw-r--r--
2022-05-16 09:16
atomicfile.py
5.33
KB
-rw-r--r--
2022-05-16 09:16
aws.py
19.38
KB
-rw-r--r--
2022-05-16 09:16
azurearm.py
11.38
KB
-rw-r--r--
2022-05-16 09:16
beacons.py
517
B
-rw-r--r--
2022-05-16 09:16
boto3_elasticsearch.py
3.73
KB
-rw-r--r--
2022-05-16 09:16
boto3mod.py
8.36
KB
-rw-r--r--
2022-05-16 09:16
boto_elb_tag.py
3.02
KB
-rw-r--r--
2022-05-16 09:16
botomod.py
7.98
KB
-rw-r--r--
2022-05-16 09:16
cache.py
9.81
KB
-rw-r--r--
2022-05-16 09:16
cloud.py
117.04
KB
-rw-r--r--
2022-05-16 09:16
color.py
2.72
KB
-rw-r--r--
2022-05-16 09:16
compat.py
1.81
KB
-rw-r--r--
2022-05-16 09:16
configcomparer.py
3.88
KB
-rw-r--r--
2022-05-16 09:16
configparser.py
10.82
KB
-rw-r--r--
2022-05-16 09:16
context.py
6.8
KB
-rw-r--r--
2022-05-16 09:16
crypt.py
4.71
KB
-rw-r--r--
2022-05-16 09:16
ctx.py
1.42
KB
-rw-r--r--
2022-05-16 09:16
data.py
49.28
KB
-rw-r--r--
2022-05-16 09:16
dateutils.py
2.31
KB
-rw-r--r--
2022-05-16 09:16
debug.py
4.19
KB
-rw-r--r--
2022-05-16 09:16
dictdiffer.py
14.16
KB
-rw-r--r--
2022-05-16 09:16
dicttrim.py
3.9
KB
-rw-r--r--
2022-05-16 09:16
dictupdate.py
11.33
KB
-rw-r--r--
2022-05-16 09:16
dns.py
35.17
KB
-rw-r--r--
2022-05-16 09:16
doc.py
2.25
KB
-rw-r--r--
2022-05-16 09:16
entrypoints.py
2.28
KB
-rw-r--r--
2022-05-16 09:16
environment.py
2.2
KB
-rw-r--r--
2022-05-16 09:16
error.py
1.18
KB
-rw-r--r--
2022-05-16 09:16
etcd_util.py
14.22
KB
-rw-r--r--
2022-05-16 09:16
event.py
52.3
KB
-rw-r--r--
2022-05-16 09:16
extend.py
8.87
KB
-rw-r--r--
2022-05-16 09:16
extmods.py
5.67
KB
-rw-r--r--
2022-05-16 09:16
filebuffer.py
3.15
KB
-rw-r--r--
2022-05-16 09:16
files.py
27.6
KB
-rw-r--r--
2022-05-16 09:16
find.py
22.09
KB
-rw-r--r--
2022-05-16 09:16
fsutils.py
3.29
KB
-rw-r--r--
2022-05-16 09:16
functools.py
5.02
KB
-rw-r--r--
2022-05-16 09:16
gitfs.py
124.49
KB
-rw-r--r--
2022-05-16 09:16
github.py
1.52
KB
-rw-r--r--
2022-05-16 09:16
gzip_util.py
2.86
KB
-rw-r--r--
2022-05-16 09:16
hashutils.py
5.91
KB
-rw-r--r--
2022-05-16 09:16
http.py
34.36
KB
-rw-r--r--
2022-05-16 09:16
iam.py
1.22
KB
-rw-r--r--
2022-05-16 09:16
icinga2.py
754
B
-rw-r--r--
2022-05-16 09:16
idem.py
1.22
KB
-rw-r--r--
2022-05-16 09:16
immutabletypes.py
2.46
KB
-rw-r--r--
2022-05-16 09:16
itertools.py
2.36
KB
-rw-r--r--
2022-05-16 09:16
jid.py
3
KB
-rw-r--r--
2022-05-16 09:16
jinja.py
31.54
KB
-rw-r--r--
2022-05-16 09:16
job.py
6.01
KB
-rw-r--r--
2022-05-16 09:16
json.py
3.78
KB
-rw-r--r--
2022-05-16 09:16
kickstart.py
41.04
KB
-rw-r--r--
2022-05-16 09:16
kinds.py
493
B
-rw-r--r--
2022-05-16 09:16
lazy.py
3.06
KB
-rw-r--r--
2022-05-16 09:16
listdiffer.py
10.9
KB
-rw-r--r--
2022-05-16 09:16
locales.py
2.06
KB
-rw-r--r--
2022-05-16 09:16
mac_utils.py
14.01
KB
-rw-r--r--
2022-05-16 09:16
mako.py
3.63
KB
-rw-r--r--
2022-05-16 09:16
master.py
29.57
KB
-rw-r--r--
2022-05-16 09:16
mattermost.py
1.77
KB
-rw-r--r--
2022-05-16 09:16
memcached.py
3.56
KB
-rw-r--r--
2022-05-16 09:16
migrations.py
1.46
KB
-rw-r--r--
2022-05-16 09:16
mine.py
3.68
KB
-rw-r--r--
2022-05-16 09:16
minion.py
4.13
KB
-rw-r--r--
2022-05-16 09:16
minions.py
43.4
KB
-rw-r--r--
2022-05-16 09:16
mount.py
1.15
KB
-rw-r--r--
2022-05-16 09:16
msazure.py
5.36
KB
-rw-r--r--
2022-05-16 09:16
msgpack.py
4.69
KB
-rw-r--r--
2022-05-16 09:16
nacl.py
13.58
KB
-rw-r--r--
2022-05-16 09:16
namecheap.py
4.32
KB
-rw-r--r--
2022-05-16 09:16
napalm.py
23.79
KB
-rw-r--r--
2022-05-16 09:16
nb_popen.py
7.24
KB
-rw-r--r--
2022-05-16 09:16
network.py
71.07
KB
-rw-r--r--
2022-05-16 09:16
nxos.py
12.94
KB
-rw-r--r--
2022-05-16 09:16
nxos_api.py
4
KB
-rw-r--r--
2022-05-16 09:16
odict.py
13.16
KB
-rw-r--r--
2022-05-16 09:16
oset.py
6.41
KB
-rw-r--r--
2022-05-16 09:16
pagerduty.py
3.03
KB
-rw-r--r--
2022-05-16 09:16
parsers.py
125.31
KB
-rw-r--r--
2022-05-16 09:16
path.py
10.78
KB
-rw-r--r--
2022-05-16 09:16
pbm.py
9.81
KB
-rw-r--r--
2022-05-16 09:16
platform.py
5.16
KB
-rw-r--r--
2022-05-16 09:16
powershell.py
4.15
KB
-rw-r--r--
2022-05-16 09:16
preseed.py
2.64
KB
-rw-r--r--
2022-05-16 09:16
process.py
43.34
KB
-rw-r--r--
2022-05-16 09:16
profile.py
3.21
KB
-rw-r--r--
2022-05-16 09:16
proxy.py
331
B
-rw-r--r--
2022-05-16 09:16
psutil_compat.py
3.65
KB
-rw-r--r--
2022-05-16 09:16
pushover.py
4.51
KB
-rw-r--r--
2022-05-16 09:16
pycrypto.py
5.39
KB
-rw-r--r--
2022-05-16 09:16
pydsl.py
13.74
KB
-rw-r--r--
2022-05-16 09:16
pyobjects.py
10.75
KB
-rw-r--r--
2022-05-16 09:16
reactor.py
19.09
KB
-rw-r--r--
2022-05-16 09:16
reclass.py
752
B
-rw-r--r--
2022-05-16 09:16
roster_matcher.py
3.55
KB
-rw-r--r--
2022-05-16 09:16
rsax931.py
8.07
KB
-rw-r--r--
2022-05-16 09:16
s3.py
8.78
KB
-rw-r--r--
2022-05-16 09:16
saltclass.py
14.27
KB
-rw-r--r--
2022-05-16 09:16
sanitizers.py
2.51
KB
-rw-r--r--
2022-05-16 09:16
schedule.py
70.67
KB
-rw-r--r--
2022-05-16 09:16
schema.py
54.26
KB
-rw-r--r--
2022-05-16 09:16
sdb.py
4.04
KB
-rw-r--r--
2022-05-16 09:16
slack.py
3.57
KB
-rw-r--r--
2022-05-16 09:16
smb.py
11.16
KB
-rw-r--r--
2022-05-16 09:16
smtp.py
3.27
KB
-rw-r--r--
2022-05-16 09:16
ssdp.py
14.75
KB
-rw-r--r--
2022-05-16 09:16
ssh.py
769
B
-rw-r--r--
2022-05-16 09:16
state.py
8.43
KB
-rw-r--r--
2022-05-16 09:16
stringio.py
355
B
-rw-r--r--
2022-05-16 09:16
stringutils.py
16.63
KB
-rw-r--r--
2022-05-16 09:16
systemd.py
5.51
KB
-rw-r--r--
2022-05-16 09:16
templates.py
23.92
KB
-rw-r--r--
2022-05-16 09:16
textformat.py
5.03
KB
-rw-r--r--
2022-05-16 09:16
thin.py
31.64
KB
-rw-r--r--
2022-05-16 09:16
timed_subprocess.py
4.06
KB
-rw-r--r--
2022-05-16 09:16
timeout.py
1.53
KB
-rw-r--r--
2022-05-16 09:16
timeutil.py
2.4
KB
-rw-r--r--
2022-05-16 09:16
url.py
4.96
KB
-rw-r--r--
2022-05-16 09:16
user.py
10.92
KB
-rw-r--r--
2022-05-16 09:16
value.py
247
B
-rw-r--r--
2022-05-16 09:16
vault.py
19.23
KB
-rw-r--r--
2022-05-16 09:16
verify.py
26.97
KB
-rw-r--r--
2022-05-16 09:16
versions.py
16.32
KB
-rw-r--r--
2022-05-16 09:16
virt.py
3.24
KB
-rw-r--r--
2022-05-16 09:16
virtualbox.py
22.43
KB
-rw-r--r--
2022-05-16 09:16
vmware.py
129.74
KB
-rw-r--r--
2022-05-16 09:16
vsan.py
17.18
KB
-rw-r--r--
2022-05-16 09:16
vt.py
30.25
KB
-rw-r--r--
2022-05-16 09:16
vt_helper.py
4.4
KB
-rw-r--r--
2022-05-16 09:16
win_chcp.py
3.7
KB
-rw-r--r--
2022-05-16 09:16
win_dacl.py
94.69
KB
-rw-r--r--
2022-05-16 09:16
win_dotnet.py
4.75
KB
-rw-r--r--
2022-05-16 09:16
win_functions.py
12.69
KB
-rw-r--r--
2022-05-16 09:16
win_lgpo_auditpol.py
8.48
KB
-rw-r--r--
2022-05-16 09:16
win_lgpo_netsh.py
17.87
KB
-rw-r--r--
2022-05-16 09:16
win_network.py
12.41
KB
-rw-r--r--
2022-05-16 09:16
win_osinfo.py
2.83
KB
-rw-r--r--
2022-05-16 09:16
win_pdh.py
13.85
KB
-rw-r--r--
2022-05-16 09:16
win_reg.py
30.05
KB
-rw-r--r--
2022-05-16 09:16
win_runas.py
10.55
KB
-rw-r--r--
2022-05-16 09:16
win_service.py
5.2
KB
-rw-r--r--
2022-05-16 09:16
win_system.py
14.47
KB
-rw-r--r--
2022-05-16 09:16
win_update.py
40.36
KB
-rw-r--r--
2022-05-16 09:16
winapi.py
818
B
-rw-r--r--
2022-05-16 09:16
xdg.py
316
B
-rw-r--r--
2022-05-16 09:16
xmlutil.py
13.91
KB
-rw-r--r--
2022-05-16 09:16
yaml.py
348
B
-rw-r--r--
2022-05-16 09:16
yamldumper.py
3.38
KB
-rw-r--r--
2022-05-16 09:16
yamlencoding.py
1.55
KB
-rw-r--r--
2022-05-16 09:16
yamlloader.py
6.21
KB
-rw-r--r--
2022-05-16 09:16
yamlloader_old.py
8.33
KB
-rw-r--r--
2022-05-16 09:16
yast.py
619
B
-rw-r--r--
2022-05-16 09:16
zeromq.py
1.65
KB
-rw-r--r--
2022-05-16 09:16
zfs.py
19.2
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
""" :copyright: Copyright 2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. salt.utils.versions ~~~~~~~~~~~~~~~~~~~ Version parsing based on distutils.version which works under python 3 because on python 3 you can no longer compare strings against integers. """ import datetime import inspect import logging import numbers import sys import warnings # pylint: disable=blacklisted-module from distutils.version import LooseVersion as _LooseVersion from distutils.version import StrictVersion as _StrictVersion # pylint: enable=blacklisted-module import salt.version log = logging.getLogger(__name__) class StrictVersion(_StrictVersion): def parse(self, vstring): _StrictVersion.parse(self, vstring) def _cmp(self, other): if isinstance(other, str): other = StrictVersion(other) return _StrictVersion._cmp(self, other) class LooseVersion(_LooseVersion): def parse(self, vstring): _LooseVersion.parse(self, vstring) # Convert every part of the version to string in order to be able to compare self._str_version = [ str(vp).zfill(8) if isinstance(vp, int) else vp for vp in self.version ] def _cmp(self, other): if isinstance(other, str): other = LooseVersion(other) string_in_version = False for part in self.version + other.version: if not isinstance(part, int): string_in_version = True break if string_in_version is False: return _LooseVersion._cmp(self, other) # If we reached this far, it means at least a part of the version contains a string # In python 3, strings and integers are not comparable if self._str_version == other._str_version: return 0 if self._str_version < other._str_version: return -1 if self._str_version > other._str_version: return 1 def _format_warning(message, category, filename, lineno, line=None): """ Replacement for warnings.formatwarning that disables the echoing of the 'line' parameter. """ return "{}:{}: {}: {}\n".format(filename, lineno, category.__name__, message) def warn_until( version, message, category=DeprecationWarning, stacklevel=None, _version_info_=None, _dont_call_warnings=False, ): """ Helper function to raise a warning, by default, a ``DeprecationWarning``, until the provided ``version``, after which, a ``RuntimeError`` will be raised to remind the developers to remove the warning because the target version has been reached. :param version: The version info or name after which the warning becomes a ``RuntimeError``. For example ``(2019, 2)``, ``3000``, ``Hydrogen`` or an instance of :class:`salt.version.SaltStackVersion` or :class:`salt.version.SaltVersion`. :param message: The warning message to be displayed. :param category: The warning class to be thrown, by default ``DeprecationWarning`` :param stacklevel: There should be no need to set the value of ``stacklevel``. Salt should be able to do the right thing. :param _version_info_: In order to reuse this function for other SaltStack projects, they need to be able to provide the version info to compare to. :param _dont_call_warnings: This parameter is used just to get the functionality until the actual error is to be issued. When we're only after the salt version checks to raise a ``RuntimeError``. """ if isinstance(version, salt.version.SaltVersion): version = salt.version.SaltStackVersion(*version.info) elif isinstance(version, int): version = salt.version.SaltStackVersion(version) elif isinstance(version, tuple): version = salt.version.SaltStackVersion(*version) elif isinstance(version, str): if version.lower() not in salt.version.SaltStackVersion.LNAMES: raise RuntimeError( "Incorrect spelling for the release name in the warn_utils " "call. Expecting one of these release names: {}".format( [vs.name for vs in salt.version.SaltVersionsInfo.versions()] ) ) version = salt.version.SaltStackVersion.from_name(version) elif not isinstance(version, salt.version.SaltStackVersion): raise RuntimeError( "The 'version' argument should be passed as a tuple, integer, string or " "an instance of 'salt.version.SaltVersion' or " "'salt.version.SaltStackVersion'." ) if stacklevel is None: # Attribute the warning to the calling function, not to warn_until() stacklevel = 2 if _version_info_ is None: _version_info_ = salt.version.__version_info__ _version_ = salt.version.SaltStackVersion(*_version_info_) if _version_ >= version: caller = inspect.getframeinfo(sys._getframe(stacklevel - 1)) raise RuntimeError( "The warning triggered on filename '{filename}', line number " "{lineno}, is supposed to be shown until version " "{until_version} is released. Current version is now " "{salt_version}. Please remove the warning.".format( filename=caller.filename, lineno=caller.lineno, until_version=version.formatted_version, salt_version=_version_.formatted_version, ), ) if _dont_call_warnings is False: warnings.warn( message.format(version=version.formatted_version), category, stacklevel=stacklevel, ) def warn_until_date( date, message, category=DeprecationWarning, stacklevel=None, _current_date=None, _dont_call_warnings=False, ): """ Helper function to raise a warning, by default, a ``DeprecationWarning``, until the provided ``date``, after which, a ``RuntimeError`` will be raised to remind the developers to remove the warning because the target date has been reached. :param date: A ``datetime.date`` or ``datetime.datetime`` instance. :param message: The warning message to be displayed. :param category: The warning class to be thrown, by default ``DeprecationWarning`` :param stacklevel: There should be no need to set the value of ``stacklevel``. Salt should be able to do the right thing. :param _dont_call_warnings: This parameter is used just to get the functionality until the actual error is to be issued. When we're only after the date checks to raise a ``RuntimeError``. """ _strptime_fmt = "%Y%m%d" if not isinstance(date, (str, datetime.date, datetime.datetime)): raise RuntimeError( "The 'date' argument should be passed as a 'datetime.date()' or " "'datetime.datetime()' objects or as string parserable by " "'datetime.datetime.strptime()' with the following format '{}'.".format( _strptime_fmt ) ) elif isinstance(date, str): date = datetime.datetime.strptime(date, _strptime_fmt) # We're really not interested in the time if isinstance(date, datetime.datetime): date = date.date() if stacklevel is None: # Attribute the warning to the calling function, not to warn_until_date() stacklevel = 2 today = _current_date or datetime.datetime.utcnow().date() if today >= date: caller = inspect.getframeinfo(sys._getframe(stacklevel - 1)) raise RuntimeError( "{message} This warning(now exception) triggered on " "filename '{filename}', line number {lineno}, is " "supposed to be shown until {date}. Today is {today}. " "Please remove the warning.".format( message=message.format(date=date.isoformat(), today=today.isoformat()), filename=caller.filename, lineno=caller.lineno, date=date.isoformat(), today=today.isoformat(), ), ) if _dont_call_warnings is False: warnings.warn( message.format(date=date.isoformat(), today=today.isoformat()), category, stacklevel=stacklevel, ) def kwargs_warn_until( kwargs, version, category=DeprecationWarning, stacklevel=None, _version_info_=None, _dont_call_warnings=False, ): """ Helper function to raise a warning (by default, a ``DeprecationWarning``) when unhandled keyword arguments are passed to function, until the provided ``version_info``, after which, a ``RuntimeError`` will be raised to remind the developers to remove the ``**kwargs`` because the target version has been reached. This function is used to help deprecate unused legacy ``**kwargs`` that were added to function parameters lists to preserve backwards compatibility when removing a parameter. See :ref:`the deprecation development docs <deprecations>` for the modern strategy for deprecating a function parameter. :param kwargs: The caller's ``**kwargs`` argument value (a ``dict``). :param version: The version info or name after which the warning becomes a ``RuntimeError``. For example ``(0, 17)`` or ``Hydrogen`` or an instance of :class:`salt.version.SaltStackVersion`. :param category: The warning class to be thrown, by default ``DeprecationWarning`` :param stacklevel: There should be no need to set the value of ``stacklevel``. Salt should be able to do the right thing. :param _version_info_: In order to reuse this function for other SaltStack projects, they need to be able to provide the version info to compare to. :param _dont_call_warnings: This parameter is used just to get the functionality until the actual error is to be issued. When we're only after the salt version checks to raise a ``RuntimeError``. """ if not isinstance(version, (tuple, str, salt.version.SaltStackVersion)): raise RuntimeError( "The 'version' argument should be passed as a tuple, string or " "an instance of 'salt.version.SaltStackVersion'." ) elif isinstance(version, tuple): version = salt.version.SaltStackVersion(*version) elif isinstance(version, str): version = salt.version.SaltStackVersion.from_name(version) if stacklevel is None: # Attribute the warning to the calling function, # not to kwargs_warn_until() or warn_until() stacklevel = 3 if _version_info_ is None: _version_info_ = salt.version.__version_info__ _version_ = salt.version.SaltStackVersion(*_version_info_) if kwargs or _version_.info >= version.info: arg_names = ", ".join("'{}'".format(key) for key in kwargs) warn_until( version, message=( "The following parameter(s) have been deprecated and " "will be removed in '{}': {}.".format(version.string, arg_names) ), category=category, stacklevel=stacklevel, _version_info_=_version_.info, _dont_call_warnings=_dont_call_warnings, ) def version_cmp(pkg1, pkg2, ignore_epoch=False): """ Compares two version strings using salt.utils.versions.LooseVersion. This is a fallback for providers which don't have a version comparison utility built into them. Return -1 if version1 < version2, 0 if version1 == version2, and 1 if version1 > version2. Return None if there was a problem making the comparison. """ normalize = lambda x: str(x).split(":", 1)[-1] if ignore_epoch else str(x) pkg1 = normalize(pkg1) pkg2 = normalize(pkg2) try: # pylint: disable=no-member if LooseVersion(pkg1) < LooseVersion(pkg2): return -1 elif LooseVersion(pkg1) == LooseVersion(pkg2): return 0 elif LooseVersion(pkg1) > LooseVersion(pkg2): return 1 except Exception as exc: # pylint: disable=broad-except log.exception(exc) return None def compare(ver1="", oper="==", ver2="", cmp_func=None, ignore_epoch=False): """ Compares two version numbers. Accepts a custom function to perform the cmp-style version comparison, otherwise uses version_cmp(). """ cmp_map = {"<": (-1,), "<=": (-1, 0), "==": (0,), ">=": (0, 1), ">": (1,)} if oper not in ("!=",) and oper not in cmp_map: log.error("Invalid operator '%s' for version comparison", oper) return False if cmp_func is None: cmp_func = version_cmp cmp_result = cmp_func(ver1, ver2, ignore_epoch=ignore_epoch) if cmp_result is None: return False # Check if integer/long if not isinstance(cmp_result, numbers.Integral): log.error("The version comparison function did not return an integer/long.") return False if oper == "!=": return cmp_result not in cmp_map["=="] else: # Gracefully handle cmp_result not in (-1, 0, 1). if cmp_result < -1: cmp_result = -1 elif cmp_result > 1: cmp_result = 1 return cmp_result in cmp_map[oper] def check_boto_reqs( boto_ver=None, boto3_ver=None, botocore_ver=None, check_boto=True, check_boto3=True ): """ Checks for the version of various required boto libs in one central location. Most boto states and modules rely on a single version of the boto, boto3, or botocore libs. However, some require newer versions of any of these dependencies. This function allows the module to pass in a version to override the default minimum required version. This function is useful in centralizing checks for ``__virtual__()`` functions in the various, and many, boto modules and states. boto_ver The minimum required version of the boto library. Defaults to ``2.0.0``. boto3_ver The minimum required version of the boto3 library. Defaults to ``1.2.6``. botocore_ver The minimum required version of the botocore library. Defaults to ``1.3.23``. check_boto Boolean defining whether or not to check for boto deps. This defaults to ``True`` as most boto modules/states rely on boto, but some do not. check_boto3 Boolean defining whether or not to check for boto3 (and therefore botocore) deps. This defaults to ``True`` as most boto modules/states rely on boto3/botocore, but some do not. """ if check_boto is True: try: # Late import so we can only load these for this function import boto has_boto = True except ImportError: has_boto = False if boto_ver is None: boto_ver = "2.0.0" if not has_boto or version_cmp(boto.__version__, boto_ver) == -1: return False, "A minimum version of boto {} is required.".format(boto_ver) if check_boto3 is True: try: # Late import so we can only load these for this function import boto3 import botocore has_boto3 = True except ImportError: has_boto3 = False # boto_s3_bucket module requires boto3 1.2.6 and botocore 1.3.23 for # idempotent ACL operations via the fix in https://github.com/boto/boto3/issues/390 if boto3_ver is None: boto3_ver = "1.2.6" if botocore_ver is None: botocore_ver = "1.3.23" if not has_boto3 or version_cmp(boto3.__version__, boto3_ver) == -1: return ( False, "A minimum version of boto3 {} is required.".format(boto3_ver), ) elif version_cmp(botocore.__version__, botocore_ver) == -1: return ( False, "A minimum version of botocore {} is required".format(botocore_ver), ) return True