diff --git a/CHANGELOG.md b/CHANGELOG.md index 4acc44cd..1041d84d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to singularity on pypi), and the versions here will coincide with these releases. ## [master](https://github.com/singularityhub/singularity-cli/tree/master) + - USER regular expression should check for USER at start of line (0.0.80) - add singularity options parameters to send to singularity (0.0.79) - add support for library:// urls (0.0.78) - instance stop with timeout argument (0.0.77) diff --git a/spython/main/parse/writers/singularity.py b/spython/main/parse/writers/singularity.py index 89808f51..d75b6fa9 100644 --- a/spython/main/parse/writers/singularity.py +++ b/spython/main/parse/writers/singularity.py @@ -171,8 +171,8 @@ def finish_section(section, name): # Convert USER lines to change user lines = [] for line in section: - if "USER" in line: - username = line.replace("USER", "").rstrip() + if re.search("^USER", line): + username = line.replace("USER", "", 1).rstrip() line = "su - %s" % username + " # " + line lines.append(line) diff --git a/spython/version.py b/spython/version.py index 2672d431..49611ad8 100644 --- a/spython/version.py +++ b/spython/version.py @@ -5,7 +5,7 @@ # with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -__version__ = "0.0.79" +__version__ = "0.0.80" AUTHOR = "Vanessa Sochat" AUTHOR_EMAIL = "vsochat@stanford.edu" NAME = "spython"