From 6b57b0bcbcbb8695c6bc072b22a0ae59ec0990b3 Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Mon, 23 Jan 2017 14:44:23 -0500 Subject: [PATCH] Collapse tagger class selection logic In 26b02a7, the utility of the `ForceVersionTagger` was merged with the base `VersionTagger`, so it is no longer necessary to ever explicitly invoke the `ForceVersionTagger` class. Furthermore, the `elif` and `else` branches of the decision tree for the tagger class were identical in the previous implementation, so they were collapsed as well. The remaining tagger class assignment is a simple query of the `tito.props` file. Signed-off-by: Steve Kuznetsov --- src/tito/cli.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/tito/cli.py b/src/tito/cli.py index c976f9c..933640c 100644 --- a/src/tito/cli.py +++ b/src/tito/cli.py @@ -640,15 +640,8 @@ class TagModule(BaseCliModule): debug("block_tagging defined in tito.props") error_out("Tagging has been disabled in this git branch.") - tagger_class = None - if self.options.use_version: - tagger_class = get_class_by_name("tito.tagger.ForceVersionTagger") - elif self.config.has_option("buildconfig", "tagger"): - tagger_class = get_class_by_name(self.config.get("buildconfig", - "tagger")) - else: - tagger_class = get_class_by_name(self.config.get( - BUILDCONFIG_SECTION, DEFAULT_TAGGER)) + tagger_class = get_class_by_name(self.config.get( + BUILDCONFIG_SECTION, DEFAULT_TAGGER)) debug("Using tagger class: %s" % tagger_class) tagger = tagger_class(config=self.config,