Made a progs (programs) folder and adjusted stack to use it.

This commit is contained in:
Joshua Harlow 2012-01-21 22:04:02 -08:00
parent 8dba5ba55f
commit ddf25a29fa
4 changed files with 25 additions and 8 deletions

@ -0,0 +1,14 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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.

@ -32,7 +32,7 @@ from devstack.components import quantum
from devstack.components import rabbit
from devstack.components import swift
LOG = logging.getLogger("devstack.actions")
LOG = logging.getLogger("devstack.progs.actions")
# This determines what classes to use to install/uninstall/...
_ACTION_CLASSES = {

@ -16,7 +16,7 @@
from devstack import utils
from devstack import log as logging
LOG = logging.getLogger("devstack.deps")
LOG = logging.getLogger("devstack.progs.deps")
def log_deps(components):

15
stack

@ -21,15 +21,18 @@ import sys
from devstack import log as logging
logging.setup()
from devstack import actions
#this handles our option parsing
from devstack import opts
from devstack import deps
from devstack import constants
#these are the program runtimes that actually do the running
from devstack.progs import actions
from devstack.progs import deps
LOG = logging.getLogger("devstack")
DEVSTACK = 'devstack'
def check_python():
def check_python(prog):
py_version = sys.version_info
major = py_version[0]
minor = py_version[1]
@ -37,14 +40,14 @@ def check_python():
LOG.error("Your python version is to old, please upgrade to >= 2.6!")
return False
if(major >= 3):
LOG.warn("%s has not been tested in python %s, use at your own risk!" % (DEVSTACK, major))
LOG.warn("%s has not been tested in python %s, use at your own risk!" % (prog, major))
return True
def main():
me = os.path.basename(sys.argv[0])
if(not check_python()):
if(not check_python(me)):
return 1
#parse and get it done!