mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Python 2.6 str.format() compatibility fixes.
This commit is contained in:
@@ -80,7 +80,7 @@ class DimensionDataModule(object):
|
||||
|
||||
# Region and location are common to all Dimension Data modules.
|
||||
region = self.module.params['region']
|
||||
self.region = 'dd-{}'.format(region)
|
||||
self.region = 'dd-{0}'.format(region)
|
||||
self.location = self.module.params['location']
|
||||
|
||||
libcloud.security.VERIFY_SSL_CERT = self.module.params['validate_certs']
|
||||
|
||||
@@ -227,7 +227,7 @@ def search_by_attributes(service, **kwargs):
|
||||
# Check if 'list' method support search(look for search parameter):
|
||||
if 'search' in inspect.getargspec(service.list)[0]:
|
||||
res = service.list(
|
||||
search=' and '.join('{}={}'.format(k, v) for k, v in kwargs.items())
|
||||
search=' and '.join('{0}={1}'.format(k, v) for k, v in kwargs.items())
|
||||
)
|
||||
else:
|
||||
res = [
|
||||
@@ -712,7 +712,7 @@ class BaseModule(object):
|
||||
|
||||
if entity is None:
|
||||
self._module.fail_json(
|
||||
msg="Entity not found, can't run action '{}'.".format(
|
||||
msg="Entity not found, can't run action '{0}'.".format(
|
||||
action
|
||||
)
|
||||
)
|
||||
|
||||
@@ -105,7 +105,7 @@ def uldap():
|
||||
def construct():
|
||||
try:
|
||||
secret_file = open('/etc/ldap.secret', 'r')
|
||||
bind_dn = 'cn=admin,{}'.format(base_dn())
|
||||
bind_dn = 'cn=admin,{0}'.format(base_dn())
|
||||
except IOError: # pragma: no cover
|
||||
secret_file = open('/etc/machine.secret', 'r')
|
||||
bind_dn = config_registry()["ldap/hostdn"]
|
||||
|
||||
Reference in New Issue
Block a user