nginx_status_facts: fix pep8 (#21963)

* nginx_status_facts: fix pep8

* remove from legacy files
This commit is contained in:
René Moser 2017-02-26 11:25:09 +01:00 committed by GitHub
parent cecf22039d
commit 06acf8ac2e
2 changed files with 5 additions and 2 deletions

View file

@ -135,7 +135,9 @@ class NginxStatusFacts(object):
return result
result['nginx_status_facts']['data'] = data
match = re.match(r'Active connections: ([0-9]+) \nserver accepts handled requests\n ([0-9]+) ([0-9]+) ([0-9]+) \nReading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)', data, re.S)
expr = r'Active connections: ([0-9]+) \nserver accepts handled requests\n ([0-9]+) ([0-9]+) ([0-9]+) \n' \
r'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)'
match = re.match(expr, data, re.S)
if match:
result['nginx_status_facts']['active_connections'] = int(match.group(1))
result['nginx_status_facts']['accepts'] = int(match.group(2))
@ -146,6 +148,7 @@ class NginxStatusFacts(object):
result['nginx_status_facts']['waiting'] = int(match.group(7))
return result
def main():
global module
module = AnsibleModule(
@ -160,5 +163,6 @@ def main():
result = dict(changed=False, ansible_facts=nginx_status_facts)
module.exit_json(**result)
if __name__ == '__main__':
main()

View file

@ -199,7 +199,6 @@ lib/ansible/modules/utilities/logic/wait_for.py
lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py
lib/ansible/modules/web_infrastructure/django_manage.py
lib/ansible/modules/web_infrastructure/jira.py
lib/ansible/modules/web_infrastructure/nginx_status_facts.py
lib/ansible/modules/windows/win_acl.py
lib/ansible/modules/windows/win_acl_inheritance.py
lib/ansible/modules/windows/win_command.py