1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

check for ubuntu distribution first

This commit is contained in:
Jimmy Tang 2013-10-19 14:41:00 +01:00
parent baebe6da0a
commit 0568abeb14

View file

@ -349,11 +349,11 @@ def main():
update_cache = module.params['update_cache']
sourceslist = None
if isinstance(distro, aptsources.distro.DebianDistribution) or \
if isinstance(distro, aptsources.distro.UbuntuDistribution):
sourceslist = UbuntuSourcesList(add_ppa_signing_keys_callback=get_add_ppa_signing_key_callback(module))
elif isinstance(distro, aptsources.distro.DebianDistribution) or \
isinstance(distro, aptsources.distro.Distribution):
sourceslist = SourcesList()
elif isinstance(distro, aptsources.distro.UbuntuDistribution):
sourceslist = UbuntuSourcesList(add_ppa_signing_keys_callback=get_add_ppa_signing_key_callback(module))
else:
module.fail_json(msg='Module apt_repository supports only Debian and Ubuntu.')