diff --git a/src/python/WMCore/Credential/Proxy.py b/src/python/WMCore/Credential/Proxy.py index 0cd47d8cad..7c6e9313e8 100644 --- a/src/python/WMCore/Credential/Proxy.py +++ b/src/python/WMCore/Credential/Proxy.py @@ -159,6 +159,8 @@ def setEnv(self, cmd): if self.uisource is not None and len(self.uisource) > 0: ret = 'source ' + self.uisource + ' && ' + ret if self.cleanEnvironment: + # Need to escape ' in cmd + ret = ret.replace("'", r"'\''") ret = "env -i sh -c '%s'" % ret return ret @@ -732,4 +734,4 @@ def getAllUserGroups(self, proxy): for attribute in attributes: splAttr = attribute.split('/') #splitted attribut filtAttr = [part for part in splAttr if not (part.startswith('Role=') or part.startswith('Capability='))] #filtered attribute - yield '/'.join(filtAttr) \ No newline at end of file + yield '/'.join(filtAttr)