Open cmackows opened 1 year ago
The root cause is dict environment
is not updated before invoking Login._login()
. If we look into ExecuteInternal.execute()
, we can see the code in the following which updates environment
,
216 # Create topology files
217 topology = tmt.steps.Topology(self.step.plan.provision.guests())
218 topology.guest = tmt.steps.GuestTopology(guest)
219
220 environment.update(topology.push(
221 dirpath=self.data_path(test, guest, full=True),
222 guest=guest,
223 logger=logger))
Hence, we should add the similar code before invoking Login._login()
.
Hi @cmackows, would you please help to explain why the environment vars like TMT_TOPOLOGY_*
are required if user runs tmt run login
?
The root cause is dict
environment
is not updated before invokingLogin._login()
. If we look intoExecuteInternal.execute()
, we can see the code in the following which updatesenvironment
,
- https://github.com/teemtee/tmt/blob/main/tmt/steps/execute/internal.py#L216
216 # Create topology files 217 topology = tmt.steps.Topology(self.step.plan.provision.guests()) 218 topology.guest = tmt.steps.GuestTopology(guest) 219 220 environment.update(topology.push( 221 dirpath=self.data_path(test, guest, full=True), 222 guest=guest, 223 logger=logger))
Hence, we should add the similar code before invoking
Login._login()
.
Agreed. Feel free to propose a patch, I started working on this but got to solving unrelated issues hence no usable PR in my stash.
Hi @cmackows, would you please help to explain why the environment vars like
TMT_TOPOLOGY_*
are required if user runstmt run login
?
My 2 cents: why wouldn’t they be exposed? :) I think of this as “test-like environment” which should be consistent across prepare, execute, finish and other places where tmt runs user code. As another example, ansible
prepare plugin should also expose them, via `—-extra-vars’ too.
- Hi @cmackows https://github.com/cmackows, would you please help to explain why the environment vars like TMTTOPOLOGY* are required if user runs tmt run login?
My 2 cents: why wouldn’t they be exposed? :) I think of this as “test-like environment” which should be consistent across prepare, execute, finish and other places where tmt runs user code. As another example, ansible prepare plugin should also expose them, via `—-extra-vars’ too.
Same as Miloš has pointed out. It leads to confusion with $TMT_TOPOLOGY_BASH not being set in login environment. -Chris
— Reply to this email directly, view it on GitHub https://github.com/teemtee/tmt/issues/2193#issuecomment-1634336751, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYTPEVHURY2HR45PGZGMSATXQAACDANCNFSM6AAAAAA2CKFSLA . You are receiving this because you were mentioned.Message ID: @.***>
$TMT_TOPOLOGY_BASH is not set when using 'login' option (for virtual guest).
$TMT_TOPOLOGY_BASH is set for prepare steps
log.txt