Remove six
Remove six.moves Replace the following items with Python 3 style code. - six.moves.urllib - six.iteritems Change-Id: I65d7a43ac9ae76e0634b72c6bb54cb3a98bd7aab
This commit is contained in:
@@ -21,11 +21,10 @@ Base utilities to build API operation managers and objects on top of.
|
|||||||
"""
|
"""
|
||||||
import abc
|
import abc
|
||||||
import copy
|
import copy
|
||||||
import six
|
|
||||||
|
|
||||||
from oslo_utils import reflection
|
from oslo_utils import reflection
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
from six.moves.urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
from adjutantclient._i18n import _
|
from adjutantclient._i18n import _
|
||||||
from adjutantclient import exc as exceptions
|
from adjutantclient import exc as exceptions
|
||||||
@@ -207,8 +206,7 @@ class BaseManager(HookableMixin):
|
|||||||
return self.client.delete(url)
|
return self.client.delete(url)
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class ManagerWithFind(BaseManager, metaclass=abc.ABCMeta):
|
||||||
class ManagerWithFind(BaseManager):
|
|
||||||
"""Manager with additional `find()`/`findall()` methods."""
|
"""Manager with additional `find()`/`findall()` methods."""
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import six
|
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib.i18n import _
|
from osc_lib.i18n import _
|
||||||
@@ -61,9 +60,8 @@ class QuotaShow(command.Lister):
|
|||||||
region = quota_data['regions'][0]
|
region = quota_data['regions'][0]
|
||||||
|
|
||||||
rows = []
|
rows = []
|
||||||
for service, service_detail in six.iteritems(
|
for service, service_detail in region['current_usage'].items():
|
||||||
region['current_usage']):
|
for resource, value in service_detail.items():
|
||||||
for resource, value in six.iteritems(service_detail):
|
|
||||||
current_quota = region['current_quota'][service].get(
|
current_quota = region['current_quota'][service].get(
|
||||||
resource)
|
resource)
|
||||||
rows.append([service, resource, current_quota, value])
|
rows.append([service, resource, current_quota, value])
|
||||||
@@ -82,9 +80,9 @@ class QuotaSizes(command.Lister):
|
|||||||
'Size Name', 'Service', 'Resource', 'Value']
|
'Size Name', 'Service', 'Resource', 'Value']
|
||||||
|
|
||||||
rows = []
|
rows = []
|
||||||
for size, size_details in six.iteritems(quota_data['quota_sizes']):
|
for size, size_details in quota_data['quota_sizes'].items():
|
||||||
for service, service_details in six.iteritems(size_details):
|
for service, service_details in size_details.items():
|
||||||
for resource, value in six.iteritems(service_details):
|
for resource, value in service_details.items():
|
||||||
rows.append([size, service, resource, value])
|
rows.append([size, service, resource, value])
|
||||||
|
|
||||||
return headers, rows
|
return headers, rows
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
from adjutantclient.common import base
|
from adjutantclient.common import base
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
from adjutantclient.common import base
|
from adjutantclient.common import base
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
from adjutantclient.common import base
|
from adjutantclient.common import base
|
||||||
from adjutantclient import exc
|
from adjutantclient import exc
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
from adjutantclient.common import base
|
from adjutantclient.common import base
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
from adjutantclient.common import base
|
from adjutantclient.common import base
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
|
|
||||||
class Token(base.Resource):
|
class Token(base.Resource):
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
from moves.urllib import parse
|
||||||
|
|
||||||
from adjutantclient.common import base
|
from adjutantclient.common import base
|
||||||
|
|
||||||
|
|||||||
@@ -14,4 +14,3 @@ oslo.utils>=3.20.0 # Apache-2.0
|
|||||||
keystoneauth1>=2.20.0 # Apache-2.0
|
keystoneauth1>=2.20.0 # Apache-2.0
|
||||||
PyYAML>=3.10.0 # MIT
|
PyYAML>=3.10.0 # MIT
|
||||||
requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0
|
requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0
|
||||||
six>=1.9.0 # MIT
|
|
||||||
|
|||||||
Reference in New Issue
Block a user