summaryrefslogtreecommitdiff
path: root/openstack_dashboard/management
diff options
context:
space:
mode:
authorIvan Kolodyazhny <e0ne@e0ne.info>2020-01-09 16:49:18 +0200
committerIvan Kolodyazhny <e0ne@e0ne.info>2020-01-15 12:47:48 +0200
commitd870b40583b2b735e43a061110380717929598ed (patch)
tree039d6f9934afe755bc1a2cd77d3d47b48e0111b9 /openstack_dashboard/management
parente976461d85f370762798316dbcc1d156ef8d4feb (diff)
downloadhorizon-d870b40583b2b735e43a061110380717929598ed.tar.gz
Remove six usage from openstack_dashboard package
We don't support Python 2 anymore so we don't need this compatibility library. six.reraise usages are left as is until it'll be moved to some base lib like oslo.utils to not re-implenent this method in Horizon. This patch also removes Python2-specific base test case methods assertItemsEqual and assertNotRegexpMatches in flavor of new Python 3 analogues. Change-Id: I26a59176be9e9f213128e4945a58b9459334b626
Diffstat (limited to 'openstack_dashboard/management')
-rw-r--r--openstack_dashboard/management/commands/horizon.wsgi.template4
-rw-r--r--openstack_dashboard/management/commands/make_web_conf.py6
2 files changed, 1 insertions, 9 deletions
diff --git a/openstack_dashboard/management/commands/horizon.wsgi.template b/openstack_dashboard/management/commands/horizon.wsgi.template
index c079c5705..82a0b203e 100644
--- a/openstack_dashboard/management/commands/horizon.wsgi.template
+++ b/openstack_dashboard/management/commands/horizon.wsgi.template
@@ -13,14 +13,10 @@
{% if ACTIVATE_THIS %}
activate_this = '{{ ACTIVATE_THIS }}'
-{% if PY2 %}
-execfile(activate_this, dict(__file__=activate_this))
-{% elif PY3 %}
exec(
compile(open(activate_this, "rb").read(), activate_this, 'exec'),
dict(__file__=activate_this)
)
-{% endif %}
# We import now instead of at the top of the module to use the virtual env
{% endif %}
import os
diff --git a/openstack_dashboard/management/commands/make_web_conf.py b/openstack_dashboard/management/commands/make_web_conf.py
index 8501fba41..d644fb65d 100644
--- a/openstack_dashboard/management/commands/make_web_conf.py
+++ b/openstack_dashboard/management/commands/make_web_conf.py
@@ -20,8 +20,6 @@ import subprocess
import sys
import warnings
-import six
-
from django.conf import settings
from django.core.management import base
from django import template
@@ -78,8 +76,6 @@ context = template.Context({
'SSLKEY': '/etc/pki/tls/private/ca.key',
'CACERT': None,
'PROCESSES': multiprocessing.cpu_count() + 1,
- 'PY2': six.PY2,
- 'PY3': six.PY3,
'PYTHON_EXEC': sys.executable,
})
@@ -120,7 +116,7 @@ for cmd in APACHE2_VERSION_CMDS:
try:
reg = re.compile(cmd[1])
output = subprocess.check_output(cmd[0], stderr=subprocess.STDOUT)
- if isinstance(output, six.binary_type):
+ if isinstance(output, bytes):
output = output.decode()
res = reg.search(output)
if res: