From cbdc5c14e102b44d2c6efda166304e63616ce8ac Mon Sep 17 00:00:00 2001 From: Ramana Juvvadi Date: Mon, 9 May 2011 11:57:33 -0500 Subject: modified keystone-control and reshuffling of file names --- bin/keystone-auth | 65 +++++++++++++++++++++++++++++++++++++++++++ bin/scripts/keystone-control | 66 -------------------------------------------- keystone/auth_server.py | 2 +- keystone/version.py | 21 ++------------ setup.py | 19 +++++++------ 5 files changed, 79 insertions(+), 94 deletions(-) create mode 100755 bin/keystone-auth delete mode 100644 bin/scripts/keystone-control diff --git a/bin/keystone-auth b/bin/keystone-auth new file mode 100755 index 00000000..c1e75daf --- /dev/null +++ b/bin/keystone-auth @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# Copyright 2011 OpenStack LLC. +# 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. + +""" +Keystone API Server +""" + +import optparse +import os +import sys + +# If ../../keystone/__init__.py exists, add ../ to Python search path, so that +# it will override what happens to be installed in /usr/(local/)lib/python... +possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), + os.pardir, + os.pardir)) +if os.path.exists(os.path.join(possible_topdir, 'keystone', '__init__.py')): + sys.path.insert(0, possible_topdir) + +from keystone import version +from keystone.common import config +from keystone.common import wsgi + + +def create_options(parser): + """ + Sets up the CLI and config-file options that may be + parsed and program commands. + + :param parser: The option parser + """ + config.add_common_options(parser) + config.add_log_options(parser) + + +if __name__ == '__main__': + oparser = optparse.OptionParser(version='%%prog %s' + % version.version_string()) + create_options(oparser) + (options, args) = config.parse_options(oparser) + + try: + conf, app = config.load_paste_app('auth_server', options, args) + server = wsgi.Server() + server.start(app, int(conf['bind_port']), conf['bind_host']) + server.wait() + except RuntimeError, e: + sys.exit("ERROR: %s" % e) diff --git a/bin/scripts/keystone-control b/bin/scripts/keystone-control deleted file mode 100644 index 5982a137..00000000 --- a/bin/scripts/keystone-control +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/python -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# Copyright 2011 OpenStack LLC. -# 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. - -""" -Glance API Server -""" - -import optparse -import os -import sys - -# If ../../keystone/__init__.py exists, add ../ to Python search path, so that -# it will override what happens to be installed in /usr/(local/)lib/python... -possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), - os.pardir, - os.pardir, - os.pardir)) -if os.path.exists(os.path.join(possible_topdir, 'keystone', '__init__.py')): - sys.path.insert(0, possible_topdir) - -from keystone import version -from keystone.common import config -from keystone.common import wsgi - - -def create_options(parser): - """ - Sets up the CLI and config-file options that may be - parsed and program commands. - - :param parser: The option parser - """ - config.add_common_options(parser) - config.add_log_options(parser) - - -if __name__ == '__main__': - oparser = optparse.OptionParser(version='%%prog %s' - % version.version_string()) - create_options(oparser) - (options, args) = config.parse_options(oparser) - - try: - conf, app = config.load_paste_app('auth_server', options, args) - server = wsgi.Server() - server.start(app, int(conf['bind_port']), conf['bind_host']) - server.wait() - except RuntimeError, e: - sys.exit("ERROR: %s" % e) diff --git a/keystone/auth_server.py b/keystone/auth_server.py index f88b715b..d8a50bf6 100755 --- a/keystone/auth_server.py +++ b/keystone/auth_server.py @@ -51,7 +51,7 @@ from webob.exc import (HTTPNotFound, HTTPBadRequest) POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), - os.pardir,os.pardir, + os.pardir, os.pardir)) if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'keystone', '__init__.py')): sys.path.insert(0, POSSIBLE_TOPDIR) diff --git a/keystone/version.py b/keystone/version.py index 15473f5b..332f5841 100755 --- a/keystone/version.py +++ b/keystone/version.py @@ -13,22 +13,14 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - -try: - from glance.vcsversion import version_info -except ImportError: - version_info = {'branch_nick': u'LOCALBRANCH', - 'revision_id': 'LOCALREVISION', - 'revno': 0} - -GLANCE_VERSION = ['2011', '2'] -YEAR, COUNT = GLANCE_VERSION +KEYSTONE_VERSION = ['1', '0'] +MAJOR, MINOR = KEYSTONE_VERSION FINAL = True # This becomes true at Release Candidate time def canonical_version_string(): - return '.'.join([YEAR, COUNT]) + return '.'.join([MAJOR, MINOR]) def version_string(): @@ -37,10 +29,3 @@ def version_string(): else: return '%s-dev' % (canonical_version_string(),) - -def vcs_version_string(): - return "%s:%s" % (version_info['branch_nick'], version_info['revision_id']) - - -def version_string_with_vcs(): - return "%s-%s" % (canonical_version_string(), vcs_version_string()) diff --git a/setup.py b/setup.py index 83ead0ca..41f326cd 100644 --- a/setup.py +++ b/setup.py @@ -30,13 +30,14 @@ setup( url='http://www.openstack.org', include_package_data=True, packages=find_packages(exclude=['test', 'bin']), - zip_safe=False, - install_requires=['setuptools'], - entry_points={ - 'paste.app_factory': ['main=identity:app_factory'], - 'paste.filter_factory': [ - 'papiauth=keystone:papiauth_factory', - 'tokenauth=keystone:tokenauth_factory', - ], - }, + scripts=['bin/keystone'] +# zip_safe=False, +# install_requires=['setuptools'], +# entry_points={ +# 'paste.app_factory': ['main=identity:app_factory'], +# 'paste.filter_factory': [ +# 'papiauth=keystone:papiauth_factory', +# 'tokenauth=keystone:tokenauth_factory', +# ], +# }, ) -- cgit