From a1235d91a209c4708ca2564db58760e1a71e702d Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 22 May 2015 12:44:32 -0700 Subject: [PATCH] Fix nevra, fixes to docs and copyright info --- lib/ansible/modules/extras/packaging/os/dnf.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/extras/packaging/os/dnf.py b/lib/ansible/modules/extras/packaging/os/dnf.py index 4eb1cc18b98..89988ea9763 100644 --- a/lib/ansible/modules/extras/packaging/os/dnf.py +++ b/lib/ansible/modules/extras/packaging/os/dnf.py @@ -1,7 +1,8 @@ #!/usr/bin/python -tt # -*- coding: utf-8 -*- -# Written by Igor Gnatenko +# Copyright 2015 Cristian van Ee +# Copyright 2015 Igor Gnatenko # # This file is part of Ansible # @@ -96,8 +97,12 @@ options: notes: [] # informational: requirements for nodes -requirements: [ dnf ] -author: '"Igor Gnatenko" ' +requirements: + - "python >= 2.6" + - dnf +author: + - '"Igor Gnatenko (@ignatenkobrain) " ' + - '"Cristian van Ee (@DJMuggs)" ' ''' EXAMPLES = ''' @@ -154,8 +159,8 @@ def pkg_to_dict(pkg): 'release': pkg.release, 'version': pkg.version, 'repo': pkg.repoid, - 'nevra': str(pkg) } + d['nevra'] = '{epoch}:{name}-{version}-{release}.{arch}'.format(**d) if pkg.installed: d['dnfstate'] = 'installed' @@ -275,5 +280,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() +if __name__ == '__main__': + main()