utils/[galaxyify-playbook,gen_module_docs].py: flake8 fixes

This commit is contained in:
Thomas Woerner
2019-07-24 18:27:41 +02:00
parent 4cd4f2cf71
commit 62097ee368
2 changed files with 39 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
import os
import sys
import re
def galaxify_playbook(playbook_in):
p1 = re.compile('(ipa.*:)$')
p2 = re.compile('(name:) (ipa.*)$')
@@ -24,8 +24,8 @@ def galaxify_playbook(playbook_in):
elif include_role and stripped.startswith("name:"):
line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line)
changed = True
elif changeable and \
not stripped.startswith("freeipa.ansible_freeipa."):
elif changeable and not stripped.startswith(
"freeipa.ansible_freeipa."):
line = p1.sub(r'freeipa.ansible_freeipa.\1', line)
changed = True
@@ -36,4 +36,5 @@ def galaxify_playbook(playbook_in):
for line in lines:
out_f.write(line)
galaxify_playbook(sys.argv[1])

View File

@@ -1,6 +1,4 @@
import os
import sys
import re
param_docs = {
"ccache": "The local ccache",
@@ -103,14 +101,16 @@ param_docs = {
"dirsrv_pin": "The password to unlock the Directory Server private key",
"http_pin": "The password to unlock the Apache Server private key",
"pkinit_pin": "The password to unlock the Kerberos KDC private key",
"dirsrv_cert_name": "Name of the Directory Server SSL certificate to install",
"dirsrv_cert_name":
"Name of the Directory Server SSL certificate to install",
"http_cert_name": "Name of the Apache Server SSL certificate to install",
"pkinit_cert_name": "Name of the Kerberos KDC SSL certificate to install",
"keytab": "Path to backed up keytab from previous enrollment",
"mkhomedir": "Create home directories for users on their first login",
"adtrust_netbios_name": "The adtrust netbios_name setting",
"adtrust_reset_netbios_name": "The adtrust reset_netbios_name setting",
"zonemgr": "DNS zone manager e-mail address. Defaults to hostmaster@DOMAIN",
"zonemgr":
"DNS zone manager e-mail address. Defaults to hostmaster@DOMAIN",
"ssh_trust_dns": "Configure OpenSSH client to trust DNS SSHFP records",
"dns_ip_addresses": "The dns ip_addresses setting",
"dns_reverse_zones": "The dns reverse_zones setting",
@@ -167,7 +167,8 @@ param_docs = {
"request_cert": "Request certificate for the machine",
"preserve_sssd": "Preserve old SSSD configuration if possible",
"no_sudo": "Do not configure SSSD as data source for sudo",
"fixed_primary": "Configure sssd to use fixed server as primary IPA server",
"fixed_primary":
"Configure sssd to use fixed server as primary IPA server",
"permit": "Disable access rules by default, permit all access",
"no_krb5_offline_passwords": [
"Configure SSSD not to store user password when the server is offline"
@@ -182,8 +183,6 @@ param_docs = {
def gen_module_docs(module_in):
lines = [ ]
with open(module_in) as in_f:
in_lines = in_f.readlines()
@@ -215,7 +214,7 @@ def gen_module_docs(module_in):
try:
param, _dict = stripped.split("=", 1)
except:
except Exception:
print("Failed to split line '%s'" % stripped)
sys.exit(1)
@@ -228,7 +227,8 @@ def gen_module_docs(module_in):
if param not in param_docs:
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print("%s: param '%s' is not in param_docs" % (module_in, param))
print("%s: param '%s' is not in param_docs" % (module_in,
param))
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
sys.exit(1)
@@ -303,4 +303,5 @@ def gen_module_docs(module_in):
for line in out_lines:
out_f.write(line)
gen_module_docs(sys.argv[1])