mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 20:22:46 +00:00
Prep for namespace change spacewalk.releng -> tito.
This commit is contained in:
parent
5090335175
commit
af72fd5572
7 changed files with 16 additions and 1 deletions
|
@ -28,7 +28,7 @@ from spacewalk.releng.tagger import VersionTagger, ReleaseTagger
|
|||
from spacewalk.releng.common import DEFAULT_BUILD_DIR
|
||||
from spacewalk.releng.common import (find_git_root, run_command,
|
||||
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"
|
||||
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
|
||||
a Class object.
|
||||
"""
|
||||
name = normalize_class_name(name)
|
||||
# Split name into module and class name:
|
||||
tokens = name.split(".")
|
||||
class_name = tokens[-1]
|
||||
|
|
|
@ -248,3 +248,17 @@ def get_latest_tagged_version(package_name):
|
|||
error_out("Error looking up latest tagged version in: %s" % file_path)
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue