]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix for bug/893663
authorTyler Smith <tylesmit@cisco.com>
Wed, 5 Jan 2011 01:48:45 +0000 (20:48 -0500)
committerTyler Smith <tylesmit@cisco.com>
Wed, 5 Jan 2011 02:03:13 +0000 (21:03 -0500)
Making Cisco CLI usable from installed packages

Change-Id: I35c34d2d0f5c050016663cf04673582806f35b39

quantum/plugins/cisco/client/__init__.py [new file with mode: 0644]
quantum/plugins/cisco/client/cli.py
setup_cisco_plugin.py
setup_common.py

diff --git a/quantum/plugins/cisco/client/__init__.py b/quantum/plugins/cisco/client/__init__.py
new file mode 100644 (file)
index 0000000..09b3fab
--- /dev/null
@@ -0,0 +1,20 @@
+"""
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+#
+# Copyright 2011 Cisco Systems, Inc.  All rights reserved.
+#
+#    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.
+#
+# @author: Sumit Naiksatam, Cisco Systems, Inc.
+#
+"""
index 0c0b9dbb3e934cca4f6202f7e5e43e5d0d4b9193..61ce1abb2270d07dd0cb1f995751f21e6afa8058 100644 (file)
@@ -36,6 +36,7 @@ import subprocess
 
 from optparse import OptionParser
 
+sys.path.append(os.getcwd())
 import quantum.client.cli as qcli
 
 POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
@@ -153,7 +154,7 @@ COMMANDS = {
     "args": ["tenant-id", "instance-id"]}, }
 
 
-if __name__ == "__main__":
+def main():
     import cli
     usagestr = "Usage: %prog [OPTIONS] <command> [args]"
     PARSER = OptionParser(usage=usagestr)
@@ -207,3 +208,7 @@ if __name__ == "__main__":
 
     LOG.info("Command execution completed")
     sys.exit(0)
+
+
+if __name__ == "__main__":
+    main()
index e9d26a3adfcf8450250a45b68b998deec7117102..a7961138fa8c45ea2f7b90d882790363fe2aa3dc 100644 (file)
@@ -66,4 +66,9 @@ setup(
     package_data=PackageData,
     data_files=DataFiles,
     eager_resources=EagerResources,
+    entry_points={
+        'console_scripts': [
+            'cisco-quantum = quantum.plugins.cisco.client.cli:main'
+        ]
+    },
 )
index 3f39b374467fcc8594efbfc863abdc2458390758..8720bfbe16667313966917c0073237245e631367 100644 (file)
@@ -44,7 +44,7 @@ PackageData = {
 
 exclude = ['quantum.client', 'quantum.client.*', 'quantum.server',
     'quantum.server.*', 'quantum.tests', 'quantum.tests.*',
-    'quantum.plugins.*']
+    'quantum.plugins.*', 'quantum.plugins']
 pkgs = find_packages('.', exclude=exclude)
 pkgs = filter(lambda x: x.startswith("quantum"), pkgs)