mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 03:44:41 +00:00
utils/[galaxyify-playbook,gen_module_docs].py: flake8 fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
def galaxify_playbook(playbook_in):
|
def galaxify_playbook(playbook_in):
|
||||||
p1 = re.compile('(ipa.*:)$')
|
p1 = re.compile('(ipa.*:)$')
|
||||||
p2 = re.compile('(name:) (ipa.*)$')
|
p2 = re.compile('(name:) (ipa.*)$')
|
||||||
@@ -24,8 +24,8 @@ def galaxify_playbook(playbook_in):
|
|||||||
elif include_role and stripped.startswith("name:"):
|
elif include_role and stripped.startswith("name:"):
|
||||||
line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line)
|
line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line)
|
||||||
changed = True
|
changed = True
|
||||||
elif changeable and \
|
elif changeable and not stripped.startswith(
|
||||||
not stripped.startswith("freeipa.ansible_freeipa."):
|
"freeipa.ansible_freeipa."):
|
||||||
line = p1.sub(r'freeipa.ansible_freeipa.\1', line)
|
line = p1.sub(r'freeipa.ansible_freeipa.\1', line)
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
@@ -36,4 +36,5 @@ def galaxify_playbook(playbook_in):
|
|||||||
for line in lines:
|
for line in lines:
|
||||||
out_f.write(line)
|
out_f.write(line)
|
||||||
|
|
||||||
|
|
||||||
galaxify_playbook(sys.argv[1])
|
galaxify_playbook(sys.argv[1])
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import re
|
|
||||||
|
|
||||||
param_docs = {
|
param_docs = {
|
||||||
"ccache": "The local ccache",
|
"ccache": "The local ccache",
|
||||||
@@ -103,14 +101,16 @@ param_docs = {
|
|||||||
"dirsrv_pin": "The password to unlock the Directory Server private key",
|
"dirsrv_pin": "The password to unlock the Directory Server private key",
|
||||||
"http_pin": "The password to unlock the Apache 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",
|
"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",
|
"http_cert_name": "Name of the Apache Server SSL certificate to install",
|
||||||
"pkinit_cert_name": "Name of the Kerberos KDC 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",
|
"keytab": "Path to backed up keytab from previous enrollment",
|
||||||
"mkhomedir": "Create home directories for users on their first login",
|
"mkhomedir": "Create home directories for users on their first login",
|
||||||
"adtrust_netbios_name": "The adtrust netbios_name setting",
|
"adtrust_netbios_name": "The adtrust netbios_name setting",
|
||||||
"adtrust_reset_netbios_name": "The adtrust reset_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",
|
"ssh_trust_dns": "Configure OpenSSH client to trust DNS SSHFP records",
|
||||||
"dns_ip_addresses": "The dns ip_addresses setting",
|
"dns_ip_addresses": "The dns ip_addresses setting",
|
||||||
"dns_reverse_zones": "The dns reverse_zones setting",
|
"dns_reverse_zones": "The dns reverse_zones setting",
|
||||||
@@ -167,7 +167,8 @@ param_docs = {
|
|||||||
"request_cert": "Request certificate for the machine",
|
"request_cert": "Request certificate for the machine",
|
||||||
"preserve_sssd": "Preserve old SSSD configuration if possible",
|
"preserve_sssd": "Preserve old SSSD configuration if possible",
|
||||||
"no_sudo": "Do not configure SSSD as data source for sudo",
|
"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",
|
"permit": "Disable access rules by default, permit all access",
|
||||||
"no_krb5_offline_passwords": [
|
"no_krb5_offline_passwords": [
|
||||||
"Configure SSSD not to store user password when the server is offline"
|
"Configure SSSD not to store user password when the server is offline"
|
||||||
@@ -182,8 +183,6 @@ param_docs = {
|
|||||||
|
|
||||||
|
|
||||||
def gen_module_docs(module_in):
|
def gen_module_docs(module_in):
|
||||||
lines = [ ]
|
|
||||||
|
|
||||||
with open(module_in) as in_f:
|
with open(module_in) as in_f:
|
||||||
in_lines = in_f.readlines()
|
in_lines = in_f.readlines()
|
||||||
|
|
||||||
@@ -215,7 +214,7 @@ def gen_module_docs(module_in):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
param, _dict = stripped.split("=", 1)
|
param, _dict = stripped.split("=", 1)
|
||||||
except:
|
except Exception:
|
||||||
print("Failed to split line '%s'" % stripped)
|
print("Failed to split line '%s'" % stripped)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@@ -228,7 +227,8 @@ def gen_module_docs(module_in):
|
|||||||
|
|
||||||
if param not in param_docs:
|
if param not in param_docs:
|
||||||
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
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("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@@ -303,4 +303,5 @@ def gen_module_docs(module_in):
|
|||||||
for line in out_lines:
|
for line in out_lines:
|
||||||
out_f.write(line)
|
out_f.write(line)
|
||||||
|
|
||||||
|
|
||||||
gen_module_docs(sys.argv[1])
|
gen_module_docs(sys.argv[1])
|
||||||
|
|||||||
Reference in New Issue
Block a user