Fix unused import and variable and correct documentation

reviewable/pr18780/r1
jonathan.lestrelin 10 years ago
parent ab8dbd90f9
commit bcee7c13cf

@ -26,16 +26,14 @@ module: pear
short_description: Manage pear/pecl packages short_description: Manage pear/pecl packages
description: description:
- Manage PHP packages with the pear package manager. - Manage PHP packages with the pear package manager.
version_added: 2.0
author: author:
- "'jonathan.lestrelin' <jonathan.lestrelin@gmail.com>" - "'jonathan.lestrelin' <jonathan.lestrelin@gmail.com>"
notes: []
requirements: []
options: options:
name: name:
description: description:
- Name of the package to install, upgrade, or remove. - Name of the package to install, upgrade, or remove.
required: true required: true
default: null
state: state:
description: description:
@ -132,7 +130,7 @@ def remove_packages(module, packages):
module.exit_json(changed=False, msg="package(s) already absent") module.exit_json(changed=False, msg="package(s) already absent")
def install_packages(module, state, packages, package_files): def install_packages(module, state, packages):
install_c = 0 install_c = 0
for i, package in enumerate(packages): for i, package in enumerate(packages):
@ -178,7 +176,6 @@ def check_packages(module, packages, state):
else: else:
module.exit_json(change=False, msg="package(s) already %s" % state) module.exit_json(change=False, msg="package(s) already %s" % state)
import os
def exe_exists(program): def exe_exists(program):
for path in os.environ["PATH"].split(os.pathsep): for path in os.environ["PATH"].split(os.pathsep):
@ -220,7 +217,7 @@ def main():
check_packages(module, pkgs, p['state']) check_packages(module, pkgs, p['state'])
if p['state'] in ['present', 'latest']: if p['state'] in ['present', 'latest']:
install_packages(module, p['state'], pkgs, pkg_files) install_packages(module, p['state'], pkgs)
elif p['state'] == 'absent': elif p['state'] == 'absent':
remove_packages(module, pkgs) remove_packages(module, pkgs)

Loading…
Cancel
Save