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

Environment from command line updated twice #2461

Closed
psss opened this issue Nov 6, 2023 · 1 comment · Fixed by #2614
Closed

Environment from command line updated twice #2461

psss opened this issue Nov 6, 2023 · 1 comment · Fixed by #2614
Assignees
Milestone

Comments

@psss
Copy link
Collaborator

psss commented Nov 6, 2023

Seems that in a76772f we've introduced duplicate plan environment update from the command line options.

The first is here:

tmt/tmt/base.py

Lines 1558 to 1562 in 722563c

self._environment = tmt.utils.environment_from_spec(
raw_fmf_environment_files=node.get("environment-file") or [],
raw_fmf_environment=node.get('environment', {}),
raw_cli_environment_files=self.opt('environment-file') or [],
raw_cli_environment=self.opt('environment'),

And the second one here:

tmt/tmt/base.py

Lines 1676 to 1677 in 722563c

# Command line variables take precedence
combined.update(self.my_run.environment)

Seems it does not break anything but we should get rid of the duplication.

@psss psss added this to the 1.30 milestone Nov 6, 2023
@psss
Copy link
Collaborator Author

psss commented Dec 5, 2023

Summary from the hacking session discussion:

  • move the gathering of imported plan environment to an environment property
  • make sure self._environment is not being accessed directly in tmt code (property should be used)

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 a pull request may close this issue.

2 participants