Fix python 2 and 3 compatibility

Changes to make the code compatible with both python 2 and 3, fixes #12
This commit is contained in:
gardar 2019-03-14 22:22:41 +00:00 committed by GitHub
parent 8c79997ef6
commit 3499d2f7be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@
#
# { "groups": ["utility", "databases"], "a": false, "b": true }
import urllib.request, urllib.parse, urllib.error
from six.moves.urllib import request, parse, error
try:
import json
@ -131,7 +131,7 @@ class ProxmoxAPI(object):
def auth(self):
request_path = '{0}api2/json/access/ticket'.format(self.options.url)
request_params = urllib.parse.urlencode({
request_params = parse.urlencode({
'username': self.options.username,
'password': self.options.password,
})