mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 05:22:05 +00:00
ipa[server,replica,client]: flake8 and pylint fixes
These are white space and line length changes to calm down pylint and flake8.
This commit is contained in:
@@ -34,7 +34,7 @@ from ipapython.version import NUM_VERSION, VERSION
|
||||
|
||||
if NUM_VERSION < 30201:
|
||||
# See ipapython/version.py
|
||||
IPA_MAJOR,IPA_MINOR,IPA_RELEASE = [ int(x) for x in VERSION.split(".", 2) ]
|
||||
IPA_MAJOR, IPA_MINOR, IPA_RELEASE = [int(x) for x in VERSION.split(".", 2)]
|
||||
IPA_PYTHON_VERSION = IPA_MAJOR*10000 + IPA_MINOR*100 + IPA_RELEASE
|
||||
else:
|
||||
IPA_PYTHON_VERSION = NUM_VERSION
|
||||
@@ -136,7 +136,7 @@ else:
|
||||
|
||||
|
||||
logger = logging.getLogger("ipa-server-install")
|
||||
#logger.setLevel(logging.DEBUG)
|
||||
# logger.setLevel(logging.DEBUG)
|
||||
standard_logging_setup(
|
||||
paths.IPASERVER_INSTALL_LOG, verbose=False, debug=False,
|
||||
filemode='a', console_format='%(message)s')
|
||||
@@ -171,7 +171,7 @@ class AnsibleModuleLog():
|
||||
pass
|
||||
|
||||
def log(self, msg):
|
||||
#self.write(msg+"\n")
|
||||
# self.write(msg+"\n")
|
||||
self.write(msg)
|
||||
|
||||
def debug(self, msg):
|
||||
@@ -182,24 +182,24 @@ class AnsibleModuleLog():
|
||||
|
||||
def write(self, msg):
|
||||
self.module.debug(msg)
|
||||
#self.module.warn(msg)
|
||||
# self.module.warn(msg)
|
||||
|
||||
|
||||
class options_obj(object):
|
||||
def __init__(self):
|
||||
self._replica_install = False
|
||||
self.dnssec_master = False # future unknown
|
||||
self.disable_dnssec_master = False # future unknown
|
||||
self.domainlevel = MAX_DOMAIN_LEVEL # deprecated
|
||||
self.domain_level = self.domainlevel # deprecated
|
||||
self.dnssec_master = False # future unknown
|
||||
self.disable_dnssec_master = False # future unknown
|
||||
self.domainlevel = MAX_DOMAIN_LEVEL # deprecated
|
||||
self.domain_level = self.domainlevel # deprecated
|
||||
self.interactive = False
|
||||
self.unattended = not self.interactive
|
||||
|
||||
#def __getattribute__(self, attr):
|
||||
# def __getattribute__(self, attr):
|
||||
# logger.info(" <-- Accessing options.%s" % attr)
|
||||
# return super(options_obj, self).__getattribute__(attr)
|
||||
|
||||
#def __getattr__(self, attr):
|
||||
# def __getattr__(self, attr):
|
||||
# logger.info(" --> Adding missing options.%s" % attr)
|
||||
# setattr(self, attr, None)
|
||||
# return getattr(self, attr)
|
||||
@@ -250,11 +250,11 @@ options.no_msdcs = False
|
||||
options.ignore_topology_disconnect = False
|
||||
options.ignore_last_of_role = False
|
||||
|
||||
|
||||
def api_Backend_ldap2(host_name, setup_ca, connect=False):
|
||||
# we are sure we have the configuration file ready.
|
||||
cfg = dict(context='installer', confdir=paths.ETC_IPA, in_server=True,
|
||||
host=host_name,
|
||||
)
|
||||
host=host_name)
|
||||
if setup_ca:
|
||||
# we have an IPA-integrated CA
|
||||
cfg['ca_host'] = host_name
|
||||
@@ -283,7 +283,7 @@ def ds_init_info(ansible_log, fstore, domainlevel, dirsrv_config_file,
|
||||
with redirect_stdout(ansible_log):
|
||||
ds.init_info(realm_name, host_name, domain_name, dm_password,
|
||||
subject_base, ca_subject, idstart, idmax,
|
||||
#hbac_allow=not no_hbac_allow,
|
||||
# hbac_allow=not no_hbac_allow,
|
||||
_dirsrv_pkcs12_info, setup_pkinit=not no_pkinit)
|
||||
else:
|
||||
ds = dsinstance.DsInstance(fstore=fstore, domainlevel=domainlevel)
|
||||
@@ -296,9 +296,10 @@ def ds_init_info(ansible_log, fstore, domainlevel, dirsrv_config_file,
|
||||
|
||||
return ds
|
||||
|
||||
|
||||
def ansible_module_get_parsed_ip_addresses(ansible_module,
|
||||
param='ip_addresses'):
|
||||
ip_addrs = [ ]
|
||||
ip_addrs = []
|
||||
for ip in ansible_module.params.get(param):
|
||||
try:
|
||||
ip_parsed = ipautil.CheckedIPAddress(ip)
|
||||
|
||||
Reference in New Issue
Block a user