¡@

Home 

OpenStack Study: api.py

OpenStack Index

**** CubicPower OpenStack Study ****

def fail(returncode, e):

    sys.stderr.write("ERROR: %s\n" % six.text_type(e))

    sys.exit(returncode)

**** CubicPower OpenStack Study ****

def main():

    try:

        config.parse_args()

        log.setup('glance')

        glance.store.create_stores()

        glance.store.verify_default_store()

        server = wsgi.Server()

        server.start(config.load_paste_app('glance-api'), default_port=9292)

        server.wait()

    except exception.WorkerCreationFailure as e:

        fail(2, e)

    except RuntimeError as e:

        fail(1, e)

if __name__ == '__main__':

    main()