mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 12:51:25 -07:00
Some beginning python3 porting for modules which have unittests
This commit is contained in:
parent
8397c8169c
commit
5f0dc2b90f
2 changed files with 10 additions and 3 deletions
|
@ -528,7 +528,12 @@ import sys
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
from urlparse import urlparse
|
try:
|
||||||
|
from urlparse import urlparse
|
||||||
|
except ImportError:
|
||||||
|
# python3
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import docker.client
|
import docker.client
|
||||||
import docker.utils
|
import docker.utils
|
||||||
|
|
|
@ -487,7 +487,8 @@ def install_deb(m, debs, cache, force, install_recommends, allow_unauthenticated
|
||||||
# to install so they're all done in one shot
|
# to install so they're all done in one shot
|
||||||
deps_to_install.extend(pkg.missing_deps)
|
deps_to_install.extend(pkg.missing_deps)
|
||||||
|
|
||||||
except Exception, e:
|
except Exception:
|
||||||
|
e = get_exception()
|
||||||
m.fail_json(msg="Unable to install package: %s" % str(e))
|
m.fail_json(msg="Unable to install package: %s" % str(e))
|
||||||
|
|
||||||
# and add this deb to the list of packages to install
|
# and add this deb to the list of packages to install
|
||||||
|
@ -643,7 +644,8 @@ def download(module, deb):
|
||||||
f.write(data)
|
f.write(data)
|
||||||
f.close()
|
f.close()
|
||||||
deb = package
|
deb = package
|
||||||
except Exception, e:
|
except Exception:
|
||||||
|
e = get_exception()
|
||||||
module.fail_json(msg="Failure downloading %s, %s" % (deb, e))
|
module.fail_json(msg="Failure downloading %s, %s" % (deb, e))
|
||||||
|
|
||||||
return deb
|
return deb
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue