#!/usr/bin/env python2

INVLIST_URL = 'http://master.tsadm.local:8000/asb/inv/lst/'

import sys
import os.path

from urllib2 import urlopen

if len(sys.argv) >= 2 and sys.argv[1] == '--list':
    try:
        print(urlopen(INVLIST_URL, timeout=15).read())
    except Exception as e:
        print(INVLIST_URL, str(e))
else:
    print('{}')

sys.exit(0)

@@ -17,16 +17,55 @@
 ython2%0A%0A
+from __future__ import print_function%0A%0A
 INVLIST_
@@ -115,16 +115,45 @@
 nv/lst/'
+%0ASSL_CERT_FILE = '.asbot.pem'
 %0A%0Aimport
@@ -202,16 +202,356 @@
 rlopen%0A%0A
+ssl_context = None%0Aif INVLIST_URL.startswith('https:'):%0A    try:%0A        import ssl%0A        ssl_context = ssl.create_default_context()%0A        ssl_context.check_hostname = False%0A        ssl_context.verify_mode = ssl.CERT_NONE%0A        ssl_context.load_cert_chain(SSL_CERT_FILE)%0A    except Exception as e:%0A        print(INVLIST_URL, str(e))%0A%0A
 if len(s
@@ -647,16 +647,37 @@
 meout=15
+, context=ssl_context
 ).read()

connect to tsadm server via https