mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Pep8 fixes for apache2 module (#24185)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
4e4fc9cb4c
commit
9d9e9a79e2
3 changed files with 25 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/python
|
||||
#coding: utf-8 -*-
|
||||
# coding: utf-8 -*-
|
||||
|
||||
# (c) 2013-2014, Christian Berendt <berendt@b1-systems.de>
|
||||
#
|
||||
|
@ -104,6 +104,7 @@ stderr:
|
|||
|
||||
import re
|
||||
|
||||
|
||||
def _run_threaded(module):
|
||||
control_binary = _get_ctl_binary(module)
|
||||
|
||||
|
@ -111,6 +112,7 @@ def _run_threaded(module):
|
|||
|
||||
return bool(re.search(r'threaded:[ ]*yes', stdout))
|
||||
|
||||
|
||||
def _get_ctl_binary(module):
|
||||
for command in ['apache2ctl', 'apachectl']:
|
||||
ctl_binary = module.get_bin_path(command)
|
||||
|
@ -122,6 +124,7 @@ def _get_ctl_binary(module):
|
|||
" At least one apache control binary is necessary."
|
||||
)
|
||||
|
||||
|
||||
def _module_is_enabled(module):
|
||||
control_binary = _get_ctl_binary(module)
|
||||
name = module.params['name']
|
||||
|
@ -146,6 +149,7 @@ def _module_is_enabled(module):
|
|||
searchstring = ' ' + create_apache_identifier(name)
|
||||
return searchstring in stdout
|
||||
|
||||
|
||||
def create_apache_identifier(name):
|
||||
"""
|
||||
By convention if a module is loaded via name, it appears in apache2ctl -M as
|
||||
|
@ -215,15 +219,16 @@ def _set_state(module, state):
|
|||
result=success_msg,
|
||||
warnings=module.warnings)
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
name = dict(required=True),
|
||||
force = dict(required=False, type='bool', default=False),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
argument_spec=dict(
|
||||
name=dict(required=True),
|
||||
force=dict(required=False, type='bool', default=False),
|
||||
state=dict(default='present', choices=['absent', 'present']),
|
||||
ignore_configcheck=dict(required=False, type='bool', default=False),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
module.warnings = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue