#!/usr/bin/env python

# Contributors Listed Below - COPYRIGHT 2016
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.

import sys
import obmc.mapper.server
from argparse import ArgumentParser

if __name__ == '__main__':
    parser = ArgumentParser()
    parser.add_argument(
        '-p', '--path_namespaces',
        required=True)
    parser.add_argument(
        '-i', '--interface_namespaces',
        required=True)
    parser.add_argument(
        '-b', '--blacklists',
        default="")
    parser.add_argument(
        '-n', '--interface_blacklists',
        default="")

    args = parser.parse_args()

    sys.exit(
        obmc.mapper.server.server_main(
            path_namespaces=args.path_namespaces.split(),
            interface_namespaces=args.interface_namespaces.split(),
            blacklists=args.blacklists.split(),
            interface_blacklists=args.interface_blacklists.split()))
