Skip to content

Commit 5d29da6

Browse files
committed
squash: simplify
1 parent 7aa9e10 commit 5d29da6

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

tmt/utils/environment.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from typing import (
3030
TYPE_CHECKING,
3131
Any,
32-
ClassVar,
3332
Optional,
3433
Union,
3534
cast,
@@ -118,14 +117,6 @@ class Environment(dict[str, EnvVarValue]):
118117
https://tmt.readthedocs.io/en/latest/spec/plans.html#environment-file.
119118
"""
120119

121-
_environ: ClassVar['Environment']
122-
123-
@classmethod
124-
def _init_environ(cls) -> None:
125-
cls._environ = Environment(
126-
{key: EnvVarValue(value) for key, value in os.environ.items()} # noqa: TID251
127-
)
128-
129120
def __init__(self, data: Optional[dict[EnvVarName, EnvVarValue]] = None) -> None:
130121
super().__init__(data or {})
131122

@@ -514,7 +505,9 @@ def from_environ(cls) -> 'Environment':
514505
Extract environment variables from the live environment
515506
"""
516507

517-
return cls._environ.copy()
508+
return Environment(
509+
{key: EnvVarValue(value) for key, value in os.environ.items()} # noqa: TID251
510+
)
518511

519512
@classmethod
520513
def from_fmf_context(cls, fmf_context: 'FmfContext') -> 'Environment':
@@ -776,6 +769,3 @@ def refresh_intrinsics(
776769
intrinsic_only=True,
777770
logger=logger,
778771
)
779-
780-
781-
Environment._init_environ()

0 commit comments

Comments
 (0)