Prep for namespace change spacewalk.releng -> tito.

This commit is contained in:
Devan Goodwin 2009-07-24 22:11:25 -03:00
parent 5090335175
commit af72fd5572
7 changed files with 16 additions and 1 deletions

View file

@ -28,7 +28,7 @@ from spacewalk.releng.tagger import VersionTagger, ReleaseTagger
from spacewalk.releng.common import DEFAULT_BUILD_DIR from spacewalk.releng.common import DEFAULT_BUILD_DIR
from spacewalk.releng.common import (find_git_root, run_command, from spacewalk.releng.common import (find_git_root, run_command,
error_out, debug, get_project_name, get_relative_project_dir, error_out, debug, get_project_name, get_relative_project_dir,
check_tag_exists, get_latest_tagged_version) check_tag_exists, get_latest_tagged_version, normalize_class_name)
BUILD_PROPS_FILENAME = "build.py.props" BUILD_PROPS_FILENAME = "build.py.props"
GLOBAL_BUILD_PROPS_FILENAME = "tito.props" GLOBAL_BUILD_PROPS_FILENAME = "tito.props"
@ -49,6 +49,7 @@ def get_class_by_name(name):
NOTE: Does not actually create an instance of the object, only returns NOTE: Does not actually create an instance of the object, only returns
a Class object. a Class object.
""" """
name = normalize_class_name(name)
# Split name into module and class name: # Split name into module and class name:
tokens = name.split(".") tokens = name.split(".")
class_name = tokens[-1] class_name = tokens[-1]

View file

@ -248,3 +248,17 @@ def get_latest_tagged_version(package_name):
error_out("Error looking up latest tagged version in: %s" % file_path) error_out("Error looking up latest tagged version in: %s" % file_path)
return output return output
def normalize_class_name(name):
"""
Just a hack to accomodate tito config files with builder/tagger
classes referenced in the spacewalk.releng namespace, which has
since been renamed to just tito.
"""
look_for = "spacewalk.releng."
if name.startswith(look_for):
name = "%s%s" % ("tito.", name[len(look_for):])
return name