diff --git a/bin/osken b/bin/osken deleted file mode 100755 index 5cc8469e..00000000 --- a/bin/osken +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. -# Copyright (C) 2014 YAMAMOTO Takashi -# -# 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. - -from os_ken.cmd.osken_base import main -main() diff --git a/bin/osken-manager b/bin/osken-manager deleted file mode 100755 index a8490cf7..00000000 --- a/bin/osken-manager +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. -# -# 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. - -from os_ken.cmd.manager import main -main() diff --git a/doc/source/components.rst b/doc/source/components.rst index b2269ca0..859335be 100644 --- a/doc/source/components.rst +++ b/doc/source/components.rst @@ -5,7 +5,7 @@ Components of OS-Ken Executables =========== -bin/osken-manager +osken-manager ------------------ The main executable. diff --git a/doc/source/parameters.rst b/doc/source/parameters.rst index 7d02f404..71d4f8a4 100644 --- a/doc/source/parameters.rst +++ b/doc/source/parameters.rst @@ -102,7 +102,7 @@ Invoking Example ================ The example is as follows:: - % PYTHONPATH=. ./bin/osken-manager --wsapi-port 8081 --verbose --app-lists os_ken.app.simple_isolation,os_ken.app.rest + % osken-manager --wsapi-port 8081 --verbose --app-lists os_ken.app.simple_isolation,os_ken.app.rest loading app os_ken.app.simple_isolation loading app os_ken.app.rest loading app os_ken.controller.ofp_handler diff --git a/doc/source/snort_integrate.rst b/doc/source/snort_integrate.rst index 4ae9d472..12c4e015 100644 --- a/doc/source/snort_integrate.rst +++ b/doc/source/snort_integrate.rst @@ -87,7 +87,7 @@ Usage 2. Run OS-Ken with sample application: :: - $ sudo ./bin/osken-manager os_ken/app/simple_switch_snort.py + $ sudo osken-manager os_ken/app/simple_switch_snort.py The incoming packets will all mirror to **port 3** which should be connect to Snort network interface. You can modify the mirror port by assign a new value in the ``self.snort_port = 3`` of ``simple_switch_snort.py`` @@ -114,7 +114,7 @@ The incoming packets will all mirror to **port 3** which should be connect to Sn 2. Run OS-Ken with sample application (On the Controller): :: - $ ./bin/osken-manager os_ken/app/simple_switch_snort.py + $ osken-manager os_ken/app/simple_switch_snort.py 3. Run Snort (On the Snort machine): :: diff --git a/doc/source/test-of-config-with-linc.rst b/doc/source/test-of-config-with-linc.rst index 4611170f..9f77b2cf 100644 --- a/doc/source/test-of-config-with-linc.rst +++ b/doc/source/test-of-config-with-linc.rst @@ -187,4 +187,4 @@ Run test_of_config app:: If you don't install os_ken and are working in the git repo directly:: - # PYTHONPATH=. ./bin/osken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest + # osken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest diff --git a/os_ken/services/protocols/vrrp/manager.py b/os_ken/services/protocols/vrrp/manager.py index 00e5d3a0..052a30ba 100644 --- a/os_ken/services/protocols/vrrp/manager.py +++ b/os_ken/services/protocols/vrrp/manager.py @@ -20,9 +20,9 @@ VRRPManager creates/deletes VRRPRouter, VRRPInterfaceMonitor dynamically as requested. Usage example -PYTHONPATH=. ./bin/osken-manager --verbose \ - os_ken.services.protocols.vrrp.manager \ - os_ken.services.protocols.vrrp.dumper +osken-manager --verbose \ + os_ken.services.protocols.vrrp.manager \ + os_ken.services.protocols.vrrp.dumper """ import time diff --git a/os_ken/services/protocols/vrrp/sample_manager.py b/os_ken/services/protocols/vrrp/sample_manager.py index e633f23f..82a211e3 100644 --- a/os_ken/services/protocols/vrrp/sample_manager.py +++ b/os_ken/services/protocols/vrrp/sample_manager.py @@ -18,10 +18,10 @@ sample router manager. (un-)instantiate routers Usage example: -PYTHONPATH=. ./bin/osken-manager --verbose \ - os_ken.services.protocols.vrrp.manager \ - os_ken.services.protocols.vrrp.dumper \ - os_ken.services.protocols.vrrp.sample_manager +osken-manager --verbose \ + os_ken.services.protocols.vrrp.manager \ + os_ken.services.protocols.vrrp.dumper \ + os_ken.services.protocols.vrrp.sample_manager """ from os_ken.base import app_manager diff --git a/os_ken/services/protocols/vrrp/sample_router.py b/os_ken/services/protocols/vrrp/sample_router.py index 19c344f2..63dbc49f 100644 --- a/os_ken/services/protocols/vrrp/sample_router.py +++ b/os_ken/services/protocols/vrrp/sample_router.py @@ -20,10 +20,10 @@ a template for router implementation that support VRRP Those routers needs to be created by someone else. sample_manager.routerManager is an example. Usage example: -PYTHONPATH=. ./bin/osken-manager --verbose \ - os_ken.services.protocols.vrrp.manager \ - os_ken.services.protocols.vrrp.dumper \ - os_ken.services.protocols.vrrp.sample_manager +osken-manager --verbose \ + os_ken.services.protocols.vrrp.manager \ + os_ken.services.protocols.vrrp.dumper \ + os_ken.services.protocols.vrrp.sample_manager """ import contextlib diff --git a/os_ken/tests/integrated/run_tests_with_ovs12.py b/os_ken/tests/integrated/run_tests_with_ovs12.py index 79c4bd15..3716f65c 100755 --- a/os_ken/tests/integrated/run_tests_with_ovs12.py +++ b/os_ken/tests/integrated/run_tests_with_ovs12.py @@ -29,7 +29,7 @@ TIMEOUT = 60 OSKEN_HOST = '127.0.0.1' OSKEN_PORT = 6633 PYTHON_BIN = '.venv/bin/python' -OSKEN_MGR = './bin/osken-manager' +OSKEN_MGR = 'osken-manager' class OVS12KernelSwitch(OVSKernelSwitch): diff --git a/os_ken/tests/integrated/test_of_config.py b/os_ken/tests/integrated/test_of_config.py index d251a14e..fa0afed4 100644 --- a/os_ken/tests/integrated/test_of_config.py +++ b/os_ken/tests/integrated/test_of_config.py @@ -33,7 +33,7 @@ Then run linc # rel/linc/bin/linc console Then run os_ken -# PYTHONPATH=. ./bin/osken-manager --verbose \ +# osken-manager --verbose \ os_ken/tests/integrated/test_of_config.py diff --git a/os_ken/tests/integrated/test_vrrp_linux_multi.py b/os_ken/tests/integrated/test_vrrp_linux_multi.py index 7e360322..c40257c5 100644 --- a/os_ken/tests/integrated/test_vrrp_linux_multi.py +++ b/os_ken/tests/integrated/test_vrrp_linux_multi.py @@ -16,11 +16,11 @@ r""" Usage: -PYTHONPATH=. ./bin/osken-manager --verbose \ - os_ken.services.protocols.vrrp.dumper \ - os_ken.services.protocols.vrrp.sample_manager.py \ - os_ken.tests.integrated.test_vrrp_linux_multi \ - os_ken.app.rest +osken-manager --verbose \ + os_ken.services.protocols.vrrp.dumper \ + os_ken.services.protocols.vrrp.sample_manager.py \ + os_ken.tests.integrated.test_vrrp_linux_multi \ + os_ken.app.rest os_ken.services.protocols.vrrp.dumper is optional. os_ken.app.rest is merely to prevent osken-manager from exiting. diff --git a/os_ken/tests/integrated/test_vrrp_multi.py b/os_ken/tests/integrated/test_vrrp_multi.py index ea75ad92..19a828b1 100644 --- a/os_ken/tests/integrated/test_vrrp_multi.py +++ b/os_ken/tests/integrated/test_vrrp_multi.py @@ -16,10 +16,10 @@ r""" Usage: -PYTHONPATH=. ./bin/osken-manager --verbose \ - os_ken.topology.switches \ - os_ken.tests.integrated.test_vrrp_multi \ - os_ken.services.protocols.vrrp.dumper +osken-manager --verbose \ + os_ken.topology.switches \ + os_ken.tests.integrated.test_vrrp_multi \ + os_ken.services.protocols.vrrp.dumper os_ken.services.protocols.vrrp.dumper is optional. diff --git a/run_tests.sh b/run_tests.sh index 6f5a1d45..19dfc866 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -90,7 +90,7 @@ run_tests() { run_pylint() { echo "Running pylint ..." PYLINT_OPTIONS="--rcfile=.pylintrc --output-format=parseable" - PYLINT_INCLUDE="os_ken bin/osken bin/osken-manager os_ken/tests/bin/osken-client" + PYLINT_INCLUDE="os_ken os_ken/tests/bin/osken-client" export PYTHONPATH=$PYTHONPATH:.os_ken PYLINT_LOG=pylint.log diff --git a/setup.cfg b/setup.cfg index a3df1312..6fe2b2c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,11 @@ classifier = packages = os_ken +[entry_points] +console_scripts = + osken = os_ken.cmd.osken_base:main + osken-manager = os_ken.cmd.manager:main + [compile_catalog] directory = os_ken/locale domain = os_ken diff --git a/tools/osken-manager.spec b/tools/osken-manager.spec deleted file mode 100644 index 43dfe79b..00000000 --- a/tools/osken-manager.spec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- mode: python -*- - -block_cipher = None - - -a = Analysis(['../bin/osken-manager'], - pathex=['../os_ken'], - binaries=None, - datas=None, - hiddenimports=['os_ken.controller.ofp_handler'], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - name='osken-manager', - debug=False, - strip=False, - upx=True, - console=True)