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:
parent
8c79997ef6
commit
3499d2f7be
|
@ -25,7 +25,7 @@
|
||||||
#
|
#
|
||||||
# { "groups": ["utility", "databases"], "a": false, "b": true }
|
# { "groups": ["utility", "databases"], "a": false, "b": true }
|
||||||
|
|
||||||
import urllib.request, urllib.parse, urllib.error
|
from six.moves.urllib import request, parse, error
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
|
@ -131,7 +131,7 @@ class ProxmoxAPI(object):
|
||||||
def auth(self):
|
def auth(self):
|
||||||
request_path = '{0}api2/json/access/ticket'.format(self.options.url)
|
request_path = '{0}api2/json/access/ticket'.format(self.options.url)
|
||||||
|
|
||||||
request_params = urllib.parse.urlencode({
|
request_params = parse.urlencode({
|
||||||
'username': self.options.username,
|
'username': self.options.username,
|
||||||
'password': self.options.password,
|
'password': self.options.password,
|
||||||
})
|
})
|
||||||
|
|
Reference in New Issue