Skip to content

Commit b30a3fa

Browse files
authored
Strip quotes from environment variables when parsing from activate.sh (#277)
This fixes parsing of environment variables that are quoted in `activate.sh`, such as ``` export NCCL_NET='AWS Libfabric' ``` Before this PR the above would be parsed to the value `'AWS Libfabric'`, literally, including the quotes. The quotes would be removed by bash, but when uenv sets environment variables the quotes are retained. In the particular case of `NCCL_NET` the quoted value is not a valid name for a plugin name, so NCCL fails to find the plugin.
1 parent 95740f0 commit b30a3fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

stackinator/etc/envvars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def read_activation_script(filename: str, env: Optional[EnvVarSet] = None) -> En
399399
continue
400400

401401
# rhs the value that is assigned to the environment variable
402-
rhs = fields[1]
402+
rhs = fields[1].lstrip("'").rstrip("'")
403403
if name in list_variables:
404404
fields = [f for f in rhs.split(":") if len(f.strip()) > 0]
405405
# look for $name as one of the fields (only works for append or prepend)

0 commit comments

Comments
 (0)