Remove six.PY3
The Python 2.7 Support has been dropped since Ussuri. So remove hacking rules for compatibility between python 2 and 3. Change-Id: Idd6a1efd1857a70fc7d960b365bfc58d6cbe00d3
This commit is contained in:
parent
b98693c708
commit
81352d08e9
@ -16,7 +16,6 @@
|
|||||||
import atexit
|
import atexit
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import six
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import timeit
|
import timeit
|
||||||
@ -33,9 +32,8 @@ def run_plain(cmd):
|
|||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
out, err = obj.communicate()
|
out, err = obj.communicate()
|
||||||
if six.PY3:
|
out = os.fsdecode(out)
|
||||||
out = os.fsdecode(out)
|
err = os.fsdecode(err)
|
||||||
err = os.fsdecode(err)
|
|
||||||
return obj.returncode, out, err
|
return obj.returncode, out, err
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ from multiprocessing import managers
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import signal
|
import signal
|
||||||
import six
|
|
||||||
import stat
|
import stat
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -67,12 +66,11 @@ class RootwrapClass(object):
|
|||||||
' '.join(userargs))
|
' '.join(userargs))
|
||||||
return cmd.RC_UNAUTHORIZED, "", ""
|
return cmd.RC_UNAUTHORIZED, "", ""
|
||||||
|
|
||||||
if six.PY3 and stdin is not None:
|
if stdin is not None:
|
||||||
stdin = os.fsencode(stdin)
|
stdin = os.fsencode(stdin)
|
||||||
out, err = obj.communicate(stdin)
|
out, err = obj.communicate(stdin)
|
||||||
if six.PY3:
|
out = os.fsdecode(out)
|
||||||
out = os.fsdecode(out)
|
err = os.fsdecode(err)
|
||||||
err = os.fsdecode(err)
|
|
||||||
return obj.returncode, out, err
|
return obj.returncode, out, err
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -19,7 +19,6 @@ import os
|
|||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import six
|
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from oslo_rootwrap import filters
|
from oslo_rootwrap import filters
|
||||||
@ -142,7 +141,7 @@ def load_filters(filters_path):
|
|||||||
filterfilepath = os.path.join(filterdir, filterfile)
|
filterfilepath = os.path.join(filterdir, filterfile)
|
||||||
if not os.path.isfile(filterfilepath):
|
if not os.path.isfile(filterfilepath):
|
||||||
continue
|
continue
|
||||||
kwargs = {"strict": False} if six.PY3 else {}
|
kwargs = {"strict": False}
|
||||||
filterconfig = moves.configparser.RawConfigParser(**kwargs)
|
filterconfig = moves.configparser.RawConfigParser(**kwargs)
|
||||||
filterconfig.read(filterfilepath)
|
filterconfig.read(filterfilepath)
|
||||||
for (name, value) in filterconfig.items("Filters"):
|
for (name, value) in filterconfig.items("Filters"):
|
||||||
|
Loading…
Reference in New Issue
Block a user