コード例 #1
0
def main():
    try:
        argv = [strutils.safe_decode(a) for a in sys.argv[1:]]
        OpenStackComputeShell().main(argv)

    except Exception as e:
        logger.debug(e, exc_info=1)
        details = {'name': strutils.safe_encode(e.__class__.__name__),
                   'msg': strutils.safe_encode(six.text_type(e))}
        print("ERROR (%(name)s): %(msg)s" % details,
              file=sys.stderr)
        sys.exit(1)
    except KeyboardInterrupt as e:
        print("Shutting down novaclient", file=sys.stderr)
        sys.exit(1)
コード例 #2
0
def main():
    try:
        argv = [strutils.safe_decode(a) for a in sys.argv[1:]]
        OpenStackComputeShell().main(argv)

    except Exception as e:
        logger.debug(e, exc_info=1)
        details = {'name': strutils.safe_encode(e.__class__.__name__),
                   'msg': strutils.safe_encode(six.text_type(e))}
        print("ERROR (%(name)s): %(msg)s" % details,
              file=sys.stderr)
        sys.exit(1)
    except KeyboardInterrupt as e:
        print("Shutting down novaclient", file=sys.stderr)
        sys.exit(1)
コード例 #3
0
ファイル: jsonutils.py プロジェクト: B-Rich/python-novaclient
def loads(s, encoding='utf-8'):
    return json.loads(strutils.safe_decode(s, encoding))
コード例 #4
0
def loads(s, encoding='utf-8'):
    return json.loads(strutils.safe_decode(s, encoding))