[Notes] [Git][BuildStream/buildstream][bschubert/fix-command-sandbox] fixup! Check is command is a str and replace by list before checking existence



Title: GitLab

Benjamin Schubert pushed to branch bschubert/fix-command-sandbox at BuildStream / buildstream

Commits:

2 changed files:

Changes:

  • buildstream/sandbox/_sandboxchroot.py
    ... ... @@ -57,15 +57,15 @@ class SandboxChroot(Sandbox):
    57 57
             cwd = self._get_work_directory(cwd=cwd)
    
    58 58
             env = self._get_environment(cwd=cwd, env=env)
    
    59 59
     
    
    60
    +        # Command must be a list
    
    61
    +        if isinstance(command, str):
    
    62
    +            command = [command]
    
    63
    +
    
    60 64
             if not self._has_command(command[0], env):
    
    61 65
                 raise SandboxError("Staged artifacts do not provide command "
    
    62 66
                                    "'{}'".format(command[0]),
    
    63 67
                                    reason='missing-command')
    
    64 68
     
    
    65
    -        # Command must be a list
    
    66
    -        if isinstance(command, str):
    
    67
    -            command = [command]
    
    68
    -
    
    69 69
             stdout, stderr = self._get_output()
    
    70 70
     
    
    71 71
             # Create the mount map, this will tell us where
    

  • buildstream/sandbox/_sandboxdummy.py
    ... ... @@ -33,6 +33,10 @@ class SandboxDummy(Sandbox):
    33 33
             cwd = self._get_work_directory(cwd=cwd)
    
    34 34
             env = self._get_environment(cwd=cwd, env=env)
    
    35 35
     
    
    36
    +        # Command must be a list
    
    37
    +        if isinstance(command, str):
    
    38
    +            command = [command]
    
    39
    +
    
    36 40
             if not self._has_command(command[0], env):
    
    37 41
                 raise SandboxError("Staged artifacts do not provide command "
    
    38 42
                                    "'{}'".format(command[0]),
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]