mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 01:44:03 -07:00
Python 2.6 str.format()
compatibility fixes.
This commit is contained in:
parent
95ff8f1a90
commit
797664d9cb
20 changed files with 43 additions and 62 deletions
|
@ -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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue