Project

General

Profile

Actions

Enhancement #25908

closed

Allow passing env vars to package managers

Added by Alexis Mousset 2 months ago. Updated 15 days ago.

Status:
Released
Priority:
N/A
Category:
Generic methods
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
To do
Fix check:
Error - Fixed
Regression:
No


Subtasks 1 (0 open1 closed)

Bug #26158: Parent breaks yum moduleReleasedFélix DALLIDETActions
Actions #1

Updated by Alexis Mousset 2 months ago

  • Status changed from New to In progress
  • Assignee set to Alexis Mousset
Actions #2

Updated by Alexis Mousset 2 months 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()
Actions #3

Updated by Alexis Mousset 2 months 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
Actions #4

Updated by Vincent MEMBRÉ 2 months ago

  • Target version changed from 8.1.9 to 8.1.10
Actions #5

Updated by Vincent MEMBRÉ about 2 months ago

  • Target version changed from 8.1.10 to 8.1.11
Actions #6

Updated by Alexis Mousset 20 days ago

  • Status changed from Pending technical review to Pending release
Actions #8

Updated by Vincent MEMBRÉ 19 days ago

  • Tracker changed from Bug to Enhancement
  • Priority deleted (0)
Actions #9

Updated by Alexis Mousset 19 days ago

  • Subtask #26158 added
Actions #10

Updated by Alexis Mousset 19 days ago

  • Fix check changed from To do to Error - Blocking
Actions #11

Updated by Alexis Mousset 19 days ago

  • Fix check changed from Error - Blocking to Error - Fixed
Actions #12

Updated by Vincent MEMBRÉ 15 days ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 8.1.11 and 8.2.4 which were released today.

Actions

Also available in: Atom PDF