#! /usr/bin/python

# Copyright (C) 2015, 2016, 2017 Cumulus Networks, Inc. All rights reserved
#
# This software is subject to the Cumulus Networks End User License Agreement available
# at the following locations:
#
# Internet: https://cumulusnetworks.com/downloads/eula/latest/view/
# Cumulus Linux systems: /usr/share/cumulus/EULA.txt

import sys
import syslog
import traceback

from restapi.cmd import runserver

if __name__ == '__main__':
    try:
        sys.exit(runserver.main())
    except Exception as ex:
        msg = 'Error %s\n. %s' % (ex, traceback.format_exc())
        syslog.openlog(logoption=syslog.LOG_PID)
        syslog.syslog(syslog.LOG_ERR, msg)
        sys.stderr.write(msg)
        sys.exit(1)
