Merge "Remove six murano/common"
This commit is contained in:
commit
ce0f00ec80
|
@ -13,8 +13,6 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import six
|
||||
|
||||
|
||||
class TokenSanitizer(object):
|
||||
"""Helper class for cleaning some object from different passwords/tokens
|
||||
|
@ -60,7 +58,7 @@ class TokenSanitizer(object):
|
|||
return [self.sanitize(item) for item in obj]
|
||||
elif isinstance(obj, tuple):
|
||||
k, v = obj
|
||||
if self._contains_token(k) and isinstance(v, six.string_types):
|
||||
if self._contains_token(k) and isinstance(v, str):
|
||||
return k, self.message
|
||||
return k, self.sanitize(v)
|
||||
else:
|
||||
|
|
|
@ -18,7 +18,6 @@ import re
|
|||
|
||||
import jsonschema
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from murano.common.i18n import _
|
||||
|
||||
|
@ -27,7 +26,7 @@ LOG = logging.getLogger(__name__)
|
|||
|
||||
|
||||
class TraverseHelper(object):
|
||||
value_type = (six.string_types, int, float, bool)
|
||||
value_type = (str, int, float, bool)
|
||||
|
||||
@staticmethod
|
||||
def get(path, source):
|
||||
|
@ -178,8 +177,8 @@ def is_different(obj1, obj2):
|
|||
|
||||
if o1 is o2:
|
||||
return
|
||||
elif (isinstance(o1, six.string_types) and
|
||||
isinstance(o2, six.string_types)) and o1 == o2:
|
||||
elif (isinstance(o1, str) and
|
||||
isinstance(o2, str)) and o1 == o2:
|
||||
return
|
||||
elif type(o1) != type(o2):
|
||||
raise Difference()
|
||||
|
|
|
@ -34,7 +34,6 @@ from oslo_service import service
|
|||
from oslo_service import sslutils
|
||||
import routes
|
||||
import routes.middleware
|
||||
import six
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
|
@ -536,7 +535,7 @@ class JSONDictSerializer(DictSerializer):
|
|||
if isinstance(obj, datetime.datetime):
|
||||
_dtime = obj - datetime.timedelta(microseconds=obj.microsecond)
|
||||
return _dtime.isoformat()
|
||||
return six.text_type(obj)
|
||||
return str(obj)
|
||||
if result:
|
||||
data.body = jsonutils.dump_as_bytes(result)
|
||||
return jsonutils.dump_as_bytes(data, default=sanitizer)
|
||||
|
@ -917,7 +916,7 @@ class JSONPatchDeserializer(TextDeserializer):
|
|||
allowed_methods = ['add', 'replace', 'remove']
|
||||
else:
|
||||
msg = _("Attribute '{0}' is invalid").format(full_path)
|
||||
raise webob.exc.HTTPForbidden(explanation=six.text_type(msg))
|
||||
raise webob.exc.HTTPForbidden(explanation=str(msg))
|
||||
|
||||
if change_op not in allowed_methods:
|
||||
ops = ', '.join(allowed_methods) if allowed_methods\
|
||||
|
@ -926,7 +925,7 @@ class JSONPatchDeserializer(TextDeserializer):
|
|||
"'{name}'. Allowed operations are: "
|
||||
"{ops}").format(method=change_op, name=full_path, ops=ops)
|
||||
|
||||
raise webob.exc.HTTPForbidden(explanation=six.text_type(msg))
|
||||
raise webob.exc.HTTPForbidden(explanation=str(msg))
|
||||
|
||||
def _validate_schema(self, change):
|
||||
property_to_update = change['value']
|
||||
|
@ -1117,6 +1116,6 @@ class FormDataDeserializer(TextDeserializer):
|
|||
def default(self, request):
|
||||
form_data_parts = request.POST
|
||||
for key, value in form_data_parts.items():
|
||||
if isinstance(value, six.string_types):
|
||||
if isinstance(value, str):
|
||||
form_data_parts[key] = self._from_json(value)
|
||||
return {'body': form_data_parts}
|
||||
|
|
Loading…
Reference in New Issue