parent
43fa3d8c14
commit
9ab21a9f0b
|
@ -25,7 +25,7 @@
|
||||||
#
|
#
|
||||||
# { "groups": ["utility", "databases"], "a": false, "b": true }
|
# { "groups": ["utility", "databases"], "a": false, "b": true }
|
||||||
|
|
||||||
import urllib
|
import urllib.request, urllib.parse, urllib.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.urlencode({
|
request_params = urllib.parse.urlencode({
|
||||||
'username': self.options.username,
|
'username': self.options.username,
|
||||||
'password': self.options.password,
|
'password': self.options.password,
|
||||||
})
|
})
|
||||||
|
@ -309,7 +309,7 @@ def main():
|
||||||
bool_validate_cert = config_data["validateCert"]
|
bool_validate_cert = config_data["validateCert"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
if os.environ.has_key('PROXMOX_INVALID_CERT'):
|
if 'PROXMOX_INVALID_CERT' in os.environ:
|
||||||
bool_validate_cert = False
|
bool_validate_cert = False
|
||||||
|
|
||||||
parser = OptionParser(usage='%prog [options] --list | --host HOSTNAME')
|
parser = OptionParser(usage='%prog [options] --list | --host HOSTNAME')
|
||||||
|
@ -334,7 +334,7 @@ def main():
|
||||||
if options.pretty:
|
if options.pretty:
|
||||||
indent = 2
|
indent = 2
|
||||||
|
|
||||||
print(json.dumps(data, indent=indent))
|
print((json.dumps(data, indent=indent)))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Reference in New Issue