Brad Bishop | 732c6db | 2015-10-19 14:49:21 -0400 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
Brad Bishop | b338560 | 2016-03-04 15:32:01 -0500 | [diff] [blame] | 3 | # Contributors Listed Below - COPYRIGHT 2016 |
Brad Bishop | 732c6db | 2015-10-19 14:49:21 -0400 | [diff] [blame] | 4 | # [+] International Business Machines Corp. |
| 5 | # |
| 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 16 | # implied. See the License for the specific language governing |
| 17 | # permissions and limitations under the License. |
| 18 | |
Brad Bishop | 63f59a7 | 2016-07-25 12:05:57 -0400 | [diff] [blame] | 19 | import sys |
| 20 | import obmc.mapper.server |
Brad Bishop | cb2e1b3 | 2017-07-09 20:11:35 -0400 | [diff] [blame] | 21 | from argparse import ArgumentParser |
Brad Bishop | 732c6db | 2015-10-19 14:49:21 -0400 | [diff] [blame] | 22 | |
Brad Bishop | 732c6db | 2015-10-19 14:49:21 -0400 | [diff] [blame] | 23 | if __name__ == '__main__': |
Brad Bishop | cb2e1b3 | 2017-07-09 20:11:35 -0400 | [diff] [blame] | 24 | parser = ArgumentParser() |
| 25 | parser.add_argument( |
| 26 | '-p', '--path_namespaces', |
Brad Bishop | 365dee3 | 2018-10-19 20:58:53 -0400 | [diff] [blame] | 27 | default="") |
Brad Bishop | cb2e1b3 | 2017-07-09 20:11:35 -0400 | [diff] [blame] | 28 | parser.add_argument( |
Brad Bishop | cfe3e44 | 2018-10-22 21:02:42 -0400 | [diff] [blame] | 29 | '-s', '--service_namespaces', |
Brad Bishop | 365dee3 | 2018-10-19 20:58:53 -0400 | [diff] [blame] | 30 | required=True) |
Brad Bishop | cfe3e44 | 2018-10-22 21:02:42 -0400 | [diff] [blame] | 31 | parser.add_argument( |
Brad Bishop | cb2e1b3 | 2017-07-09 20:11:35 -0400 | [diff] [blame] | 32 | '-i', '--interface_namespaces', |
| 33 | required=True) |
| 34 | parser.add_argument( |
| 35 | '-b', '--blacklists', |
| 36 | default="") |
| 37 | parser.add_argument( |
Brad Bishop | cfe3e44 | 2018-10-22 21:02:42 -0400 | [diff] [blame] | 38 | '-x', '--service_blacklists', |
| 39 | default="") |
| 40 | parser.add_argument( |
Brad Bishop | cb2e1b3 | 2017-07-09 20:11:35 -0400 | [diff] [blame] | 41 | '-n', '--interface_blacklists', |
| 42 | default="") |
| 43 | |
| 44 | args = parser.parse_args() |
| 45 | |
| 46 | sys.exit( |
| 47 | obmc.mapper.server.server_main( |
| 48 | path_namespaces=args.path_namespaces.split(), |
Brad Bishop | cfe3e44 | 2018-10-22 21:02:42 -0400 | [diff] [blame] | 49 | service_namespaces=args.service_namespaces.split(), |
Brad Bishop | cb2e1b3 | 2017-07-09 20:11:35 -0400 | [diff] [blame] | 50 | interface_namespaces=args.interface_namespaces.split(), |
| 51 | blacklists=args.blacklists.split(), |
Brad Bishop | cfe3e44 | 2018-10-22 21:02:42 -0400 | [diff] [blame] | 52 | service_blacklists=args.service_blacklists.split(), |
Brad Bishop | cb2e1b3 | 2017-07-09 20:11:35 -0400 | [diff] [blame] | 53 | interface_blacklists=args.interface_blacklists.split())) |