Remove six
Change-Id: I15ab42b44fbc40a66a52d1fd16087ee18c8b0494
This commit is contained in:
parent
22efa8fd7f
commit
f91d017789
|
@ -48,7 +48,6 @@ from novaclient import exceptions as nova_exceptions
|
|||
from openstack_dashboard.api import nova
|
||||
from openstack_dashboard.usage import quotas
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from muranoclient.common import exceptions as exc
|
||||
from muranodashboard import api
|
||||
|
@ -68,7 +67,7 @@ LATEST_APPS_QUEUE_LIMIT = 3
|
|||
|
||||
class DictToObj(object):
|
||||
def __init__(self, **kwargs):
|
||||
for key, value in six.iteritems(kwargs):
|
||||
for key, value in iter(kwargs.items()):
|
||||
setattr(self, key, value)
|
||||
|
||||
|
||||
|
@ -407,7 +406,7 @@ class Wizard(generic_views.PageTitleMixin, views.ModalFormMixin, LazyWizard):
|
|||
messages.success(self.request, message)
|
||||
|
||||
if do_redirect:
|
||||
return http.HttpResponseRedirect(six.text_type(env_url))
|
||||
return http.HttpResponseRedirect(str(env_url))
|
||||
else:
|
||||
srv_id = getattr(srv, '?')['id']
|
||||
return self.create_hacked_response(
|
||||
|
@ -554,8 +553,8 @@ class Wizard(generic_views.PageTitleMixin, views.ModalFormMixin, LazyWizard):
|
|||
def aggregate_usages(steps):
|
||||
result = collections.defaultdict(dict)
|
||||
for step in steps:
|
||||
for region, region_usages in six.iteritems(step):
|
||||
for metric, value in six.iteritems(region_usages):
|
||||
for region, region_usages in iter(step.items()):
|
||||
for metric, value in iter(region_usages.items()):
|
||||
if metric not in result[region]:
|
||||
result[region][metric] = 0
|
||||
result[region][metric] += value
|
||||
|
|
|
@ -37,7 +37,6 @@ from openstack_dashboard.api import glance
|
|||
from openstack_dashboard.api import neutron
|
||||
from oslo_log import log as logging
|
||||
from oslo_log import versionutils
|
||||
import six
|
||||
from yaql import legacy
|
||||
|
||||
from muranodashboard.api import packages as pkg_api
|
||||
|
@ -57,7 +56,7 @@ def with_request(func):
|
|||
"""
|
||||
def update(self, initial, request=None, **kwargs):
|
||||
initial_request = initial.get('request')
|
||||
for key, value in six.iteritems(initial):
|
||||
for key, value in iter(initial.items()):
|
||||
if key != 'request' and key not in kwargs:
|
||||
kwargs[key] = value
|
||||
|
||||
|
@ -501,7 +500,7 @@ class ImageChoiceField(ChoiceField):
|
|||
continue
|
||||
image_map[image.id] = title
|
||||
|
||||
for id_, title in sorted(six.iteritems(image_map),
|
||||
for id_, title in sorted(iter(image_map.items()),
|
||||
key=lambda e: e[1].title):
|
||||
image_choices.append((id_, title))
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
from horizon import exceptions
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from muranoclient.common import exceptions as exc
|
||||
from muranodashboard import api
|
||||
|
@ -406,7 +405,7 @@ def extract_actions_list(service):
|
|||
return dict(_action.items() + [('id', action_id)])
|
||||
|
||||
return [make_action_datum(_id, action) for (_id, action) in
|
||||
six.iteritems(actions_data) if action.get('enabled')]
|
||||
iter(actions_data.items()) if action.get('enabled')]
|
||||
|
||||
|
||||
def run_action(request, environment_id, action_id):
|
||||
|
|
|
@ -29,7 +29,6 @@ from horizon.utils import filters
|
|||
from muranoclient.common import exceptions as exc
|
||||
from openstack_dashboard import policy
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from muranodashboard import api as api_utils
|
||||
from muranodashboard.api import packages as pkg_api
|
||||
|
@ -380,7 +379,7 @@ class DeployThisEnvironment(tables.Action):
|
|||
redirect=reverse('horizon:app-catalog:environments:index'))
|
||||
redirect_to = reverse('horizon:app-catalog:environments:services',
|
||||
args=(environment_id,))
|
||||
return django_http.HttpResponseRedirect(six.text_type(redirect_to))
|
||||
return django_http.HttpResponseRedirect(str(redirect_to))
|
||||
|
||||
|
||||
class ShowEnvironmentServices(tables.LinkAction):
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
# under the License.
|
||||
|
||||
import contextlib
|
||||
from io import BytesIO
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import six
|
||||
import six.moves.urllib.parse as urlparse
|
||||
import testtools
|
||||
import time
|
||||
import urllib.parse as urlparse
|
||||
import uuid
|
||||
|
||||
from glanceclient import client as gclient
|
||||
|
@ -418,7 +418,7 @@ class ImageTestCase(PackageBase):
|
|||
container_format='bare',
|
||||
is_public='True',
|
||||
murano_image_info=murano_property)
|
||||
image_data = six.BytesIO(None)
|
||||
image_data = BytesIO(None)
|
||||
cls.glance.images.upload(image['id'], image_data)
|
||||
except Exception:
|
||||
logger.error("Unable to create or update image in Glance")
|
||||
|
|
|
@ -10,19 +10,18 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from http import server as SimpleHTTPServer
|
||||
import multiprocessing
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import socketserver
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
import uuid
|
||||
import zipfile
|
||||
|
||||
from six.moves import SimpleHTTPServer
|
||||
from six.moves import socketserver
|
||||
|
||||
from selenium.common import exceptions
|
||||
from selenium.webdriver.common import by
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
|
|
|
@ -14,25 +14,17 @@
|
|||
|
||||
from unittest import mock
|
||||
|
||||
from six import PY3
|
||||
|
||||
from muranoclient.v1 import client
|
||||
from muranodashboard.api import packages
|
||||
from openstack_dashboard.test import helpers
|
||||
|
||||
|
||||
def mock_next(obj, attr, value):
|
||||
if PY3:
|
||||
setattr(obj.__next__, attr, value)
|
||||
else:
|
||||
setattr(obj.next, attr, value)
|
||||
setattr(obj.__next__, attr, value)
|
||||
|
||||
|
||||
class MagicIterMock(mock.MagicMock):
|
||||
if PY3:
|
||||
__next__ = mock.Mock(return_value=None)
|
||||
else:
|
||||
next = mock.Mock(return_value=None)
|
||||
__next__ = mock.Mock(return_value=None)
|
||||
|
||||
|
||||
class TestPackagesAPI(helpers.APITestCase):
|
||||
|
|
Loading…
Reference in New Issue