Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix traceback related to undefined variable #487

Closed
wants to merge 1 commit into from

Conversation

praiskup
Copy link
Member

Reverts part of 68d8b21

error_out("Unable to locate branch configuration: %s\n"
"Please run 'tito init' or use '--without-init' parameter"
% filename)

config = RawConfigParser()
config.read(filename)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename here was undefined.

@praiskup
Copy link
Member Author

Fixes #486

filename = os.path.join(rel_eng_dir, TITO_PROPS)
if not os.path.exists(filename):
error_out("Unable to locate branch configuration: %s\n"
"Please run 'tito init' or use '--without-init' parameter"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment doesn't feel right :-) but it fixes the bug... so perhaps we don't need to check for the file existence?

@FrostyX
Copy link
Member

FrostyX commented Jan 21, 2024

I'd propose a different fix. Maybe I am missing something though. Do you think this will work?
(patch is against master)

diff --git a/src/tito/cli.py b/src/tito/cli.py
index 762f49b..3d3a520 100644
--- a/src/tito/cli.py
+++ b/src/tito/cli.py
@@ -98,7 +98,7 @@ def _read_config(self):
         # building, we may also load that and potentially override some global
         # settings.
         config = RawConfigParser()
-        config.read(filename)
+        config.read(self.tito_props_path)

         self._check_legacy_globalconfig(config)
         return config

FrostyX added a commit to FrostyX/tito that referenced this pull request Jan 28, 2024
FrostyX added a commit that referenced this pull request Jan 28, 2024
@FrostyX
Copy link
Member

FrostyX commented Jan 28, 2024

I think we can close this in favor of PR #489

@praiskup
Copy link
Member Author

Agreed.

@praiskup praiskup closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants