summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oslo_rootwrap/filters.py7
-rw-r--r--oslo_rootwrap/wrapper.py5
2 files changed, 10 insertions, 2 deletions
diff --git a/oslo_rootwrap/filters.py b/oslo_rootwrap/filters.py
index a996ea0..1950f02 100644
--- a/oslo_rootwrap/filters.py
+++ b/oslo_rootwrap/filters.py
@@ -14,9 +14,14 @@
# under the License.
import os
-import pwd
import re
import shutil
+import sys
+
+if sys.platform != 'win32':
+ # NOTE(claudiub): pwd is a Linux-specific library, and currently there is
+ # no Windows support for oslo.rootwrap.
+ import pwd
def _getuid(user):
diff --git a/oslo_rootwrap/wrapper.py b/oslo_rootwrap/wrapper.py
index 998beae..49fdac3 100644
--- a/oslo_rootwrap/wrapper.py
+++ b/oslo_rootwrap/wrapper.py
@@ -16,8 +16,11 @@
import logging
import logging.handlers
import os
-import pwd
import signal
+import sys
+
+if sys.platform != 'win32':
+ import pwd
import six
from six import moves