Avoid importing Linux specific modules on Windows
oslo.rootwrap currently imports a few Linux-specific modules, which means that any services importing oslo.rootwrap modules will fail to start on Windows (e.g.: neutron-ovs-agent). Change-Id: I229c311939facdffdcde484f590e980102024b5a Closes-Bug: #1661326
This commit is contained in:
parent
458d79b61a
commit
847c28abcf
@ -14,9 +14,14 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pwd
|
|
||||||
import re
|
import re
|
||||||
import shutil
|
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):
|
def _getuid(user):
|
||||||
|
@ -16,8 +16,11 @@
|
|||||||
import logging
|
import logging
|
||||||
import logging.handlers
|
import logging.handlers
|
||||||
import os
|
import os
|
||||||
import pwd
|
|
||||||
import signal
|
import signal
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if sys.platform != 'win32':
|
||||||
|
import pwd
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from six import moves
|
from six import moves
|
||||||
|
Loading…
x
Reference in New Issue
Block a user