diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-02-25 19:53:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-02-25 19:53:56 +0000 |
commit | 0fa59b04e89ad94085780550466368e6f351a9e1 (patch) | |
tree | f9b08f71d368f6bba535b8d6df38e9d1bb5f6c7f | |
parent | 1335a543be0e8c15fe8a8f06e3c29fe2f1e14a45 (diff) | |
parent | 847c28abcfe508c7b63f5b9bc78cbc8962a2c8b7 (diff) | |
download | oslo-rootwrap-0fa59b04e89ad94085780550466368e6f351a9e1.tar.gz |
Merge "Avoid importing Linux specific modules on Windows"
-rw-r--r-- | oslo_rootwrap/filters.py | 7 | ||||
-rw-r--r-- | oslo_rootwrap/wrapper.py | 5 |
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 |