summaryrefslogtreecommitdiff
path: root/oslo_rootwrap/filters.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_rootwrap/filters.py')
-rw-r--r--oslo_rootwrap/filters.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/oslo_rootwrap/filters.py b/oslo_rootwrap/filters.py
index b8747ae..1d5da26 100644
--- a/oslo_rootwrap/filters.py
+++ b/oslo_rootwrap/filters.py
@@ -57,9 +57,9 @@ class CommandFilter(object):
return ['sudo', '-u', self.run_as, to_exec] + userargs[1:]
return [to_exec] + userargs[1:]
- def get_environment(self, userargs, env=None):
+ def get_environment(self, userargs):
"""Returns specific environment to set, None if none."""
- return env
+ return None
class RegExpFilter(CommandFilter):
@@ -277,10 +277,8 @@ class EnvFilter(CommandFilter):
to_exec = self.get_exec(exec_dirs=exec_dirs) or self.exec_path
return [to_exec] + self.exec_args(userargs)[1:]
- def get_environment(self, userargs, env=None):
- if env is None:
- env = os.environ
- env = env.copy()
+ def get_environment(self, userargs):
+ env = os.environ.copy()
# ignore leading 'env'
if userargs[0] == 'env':