import time
import requests
-import six
from teuthology.exceptions import CommandFailedError
from tasks.mgr.mgr_test_case import MgrTestCase
return obj
return None
-
+# TODP: pass defaults=(False,) to namedtuple() if python3.7
class JLeaf(namedtuple('JLeaf', ['typ', 'none'])):
def __new__(cls, typ, none=False):
- if typ == str:
- typ = six.string_types
- return super(JLeaf, cls).__new__(cls, typ, none)
-
+ return super().__new__(cls, typ, none)
JList = namedtuple('JList', ['elem_typ'])
for key in unknown_keys
)
return result
- if schema in [str, int, float, bool, six.string_types]:
+ if schema in [str, int, float, bool]:
return _validate_json(val, JLeaf(schema), path)
assert False, str(path)
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-import six
from contextlib import contextmanager
from .helper import DashboardTestCase, JObj, JList, JLeaf
# Name
self.assertToHave(data, 'name')
- self.assertIsInstance(data['name'], six.string_types)
+ self.assertIsInstance(data['name'], str)
# Standbys
self.assertToHave(data, 'standbys')
- self.assertIsInstance(data['standbys'], six.string_types)
+ self.assertIsInstance(data['standbys'], str)
# MDS counters
counters = data['mds_counters']
from __future__ import absolute_import
-import six
-
from .helper import DashboardTestCase, JObj, JList
'max_size': int,
'min_size': int,
'rule_id': int,
- 'rule_name': six.string_types,
+ 'rule_name': str,
'ruleset': int,
'steps': JList(JObj({}, allow_unknown=True))
}, allow_unknown=True)
self._get('/ui-api/crush_rule/info')
self.assertStatus(200)
self.assertSchemaBody(JObj({
- 'names': JList(six.string_types),
+ 'names': JList(str),
'nodes': JList(JObj({}, allow_unknown=True))
}))
from __future__ import absolute_import
-import six
-
from .helper import DashboardTestCase, JObj, JList
def test_ecp_info(self):
self._get('/ui-api/erasure_code_profile/info')
self.assertSchemaBody(JObj({
- 'names': JList(six.string_types),
- 'plugins': JList(six.string_types),
- 'directory': six.string_types,
+ 'names': JList(str),
+ 'plugins': JList(str),
+ 'directory': str,
'nodes': JList(JObj({}, allow_unknown=True))
}))
from __future__ import absolute_import
import logging
-import six
import time
from contextlib import contextmanager
def test_pool_info(self):
self._get("/ui-api/pool/info")
self.assertSchemaBody(JObj({
- 'pool_names': JList(six.string_types),
- 'compression_algorithms': JList(six.string_types),
- 'compression_modes': JList(six.string_types),
+ 'pool_names': JList(str),
+ 'compression_algorithms': JList(str),
+ 'compression_modes': JList(str),
'is_all_bluestore': bool,
- 'bluestore_compression_algorithm': six.string_types,
+ 'bluestore_compression_algorithm': str,
'osd_count': int,
'crush_rules_replicated': JList(JObj({}, allow_unknown=True)),
'crush_rules_erasure': JList(JObj({}, allow_unknown=True)),
- 'pg_autoscale_default_mode': six.string_types,
- 'pg_autoscale_modes': JList(six.string_types),
+ 'pg_autoscale_default_mode': str,
+ 'pg_autoscale_modes': JList(str),
'erasure_code_profiles': JList(JObj({}, allow_unknown=True)),
'used_rules': JObj({}, allow_unknown=True),
'used_profiles': JObj({}, allow_unknown=True),
import logging
import time
+from urllib import parse
+
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.twofactor.totp import TOTP
from cryptography.hazmat.primitives.hashes import SHA1
-from six.moves.urllib import parse
from .helper import DashboardTestCase, JObj, JList, JLeaf