Actions
Bug #25908
openAllow passing env vars to package managers
Status:
Pending technical review
Priority:
N/A
Assignee:
Category:
Generic methods
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No
Updated by Alexis Mousset about 1 month ago
- Status changed from New to In progress
- Assignee set to Alexis Mousset
Updated by Alexis Mousset about 1 month ago · Edited
Tested behavior with:
import os
import unittest
from pprint import pprint
def env(option):
if option.startswith("env:"):
env_option = option.split(":", 1)[1]
env_var = env_option.split("=", 1)
if len(env_var) == 2:
return env_var
# os.environ[env_var[0]] = env_var[1]
else:
return None
class TestEnvOption(unittest.TestCase):
def test_upper(self):
self.assertEqual(env(""), None)
self.assertEqual(env("--ignore"), None)
self.assertEqual(env("env:"), None)
self.assertEqual(env("env:NAME"), None)
self.assertEqual(env("env:NAME=VALUE"), ["NAME", "VALUE"])
# allow unsetting a variable
self.assertEqual(env("env:NAME="), ["NAME", ""])
self.assertEqual(env("env:NAME=VALUE=PLOP"), ["NAME", "VALUE=PLOP"])
if __name__ == "__main__":
unittest.main()
Updated by Alexis Mousset about 1 month ago
- Status changed from In progress to Pending technical review
- Assignee changed from Alexis Mousset to Félix DALLIDET
- Pull Request set to https://github.com/Normation/ncf/pull/1436
Updated by Vincent MEMBRÉ 25 days ago
- Target version changed from 8.1.9 to 8.1.10
Updated by Vincent MEMBRÉ 20 days ago
- Target version changed from 8.1.10 to 8.1.11
Actions