Hacking: Fix E305
Fix: E305 expected 2 blank lines after class or function definition, found 1 Fix also other problems found by hacking in these files. Change-Id: I880afc40adf974cbb0e60f8dc5931f77d51f451b
This commit is contained in:
parent
0c6b39d9a2
commit
8098045f2a
|
@ -334,6 +334,7 @@ def validate_common_name(access):
|
||||||
exc_str = _('Invalid CN (common name). Must be 1-64 chars long.')
|
exc_str = _('Invalid CN (common name). Must be 1-64 chars long.')
|
||||||
raise webob.exc.HTTPBadRequest(explanation=exc_str)
|
raise webob.exc.HTTPBadRequest(explanation=exc_str)
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
for the reference specification for AD usernames, reference below links:
|
for the reference specification for AD usernames, reference below links:
|
||||||
|
|
||||||
|
@ -343,8 +344,8 @@ for the reference specification for AD usernames, reference below links:
|
||||||
|
|
||||||
|
|
||||||
def validate_username(access):
|
def validate_username(access):
|
||||||
sole_periods_spaces_re = '[\s|\.]+$'
|
sole_periods_spaces_re = r'[\s|\.]+$'
|
||||||
valid_username_re = '.[^\"\/\\\[\]\:\;\|\=\,\+\*\?\<\>]{3,254}$'
|
valid_username_re = r'.[^\"\/\\\[\]\:\;\|\=\,\+\*\?\<\>]{3,254}$'
|
||||||
username = access
|
username = access
|
||||||
|
|
||||||
if re.match(sole_periods_spaces_re, username):
|
if re.match(sole_periods_spaces_re, username):
|
||||||
|
@ -355,7 +356,7 @@ def validate_username(access):
|
||||||
if not re.match(valid_username_re, username):
|
if not re.match(valid_username_re, username):
|
||||||
exc_str = ('Invalid user or group name. Must be 4-255 characters '
|
exc_str = ('Invalid user or group name. Must be 4-255 characters '
|
||||||
'and consist of alphanumeric characters and '
|
'and consist of alphanumeric characters and '
|
||||||
'exclude special characters "/\[]:;|=,+*?<>')
|
'exclude special characters "/\\[]:;|=,+*?<>')
|
||||||
raise webob.exc.HTTPBadRequest(explanation=exc_str)
|
raise webob.exc.HTTPBadRequest(explanation=exc_str)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ class Limit(object):
|
||||||
"resetTime": int(self.next_request or self._get_time()),
|
"resetTime": int(self.next_request or self._get_time()),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# "Limit" format is a dictionary with the HTTP verb, human-readable URI,
|
# "Limit" format is a dictionary with the HTTP verb, human-readable URI,
|
||||||
# a regular-expression to match, value and unit of measure (PER_DAY, etc.)
|
# a regular-expression to match, value and unit of measure (PER_DAY, etc.)
|
||||||
|
|
||||||
|
|
|
@ -49,5 +49,6 @@ def main():
|
||||||
return upgradecheck.main(
|
return upgradecheck.main(
|
||||||
cfg.CONF, project='manila', upgrade_command=Checks())
|
cfg.CONF, project='manila', upgrade_command=Checks())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
|
@ -36,5 +36,6 @@ def get_maker(engine, autocommit=True, expire_on_commit=False):
|
||||||
expire_on_commit=expire_on_commit,
|
expire_on_commit=expire_on_commit,
|
||||||
query_cls=Query)
|
query_cls=Query)
|
||||||
|
|
||||||
|
|
||||||
# NOTE(uglide): Monkey patch oslo_db get_maker() function to use custom Query
|
# NOTE(uglide): Monkey patch oslo_db get_maker() function to use custom Query
|
||||||
orm.get_maker = get_maker
|
orm.get_maker = get_maker
|
||||||
|
|
|
@ -41,7 +41,7 @@ class EvalConstant(object):
|
||||||
def eval(self):
|
def eval(self):
|
||||||
result = self.value
|
result = self.value
|
||||||
if (isinstance(result, six.string_types) and
|
if (isinstance(result, six.string_types) and
|
||||||
re.match("^[a-zA-Z_]+\.[a-zA-Z_]+$", result)):
|
re.match(r"^[a-zA-Z_]+\.[a-zA-Z_]+$", result)):
|
||||||
(which_dict, entry) = result.split('.')
|
(which_dict, entry) = result.split('.')
|
||||||
try:
|
try:
|
||||||
result = _vars[which_dict][entry]
|
result = _vars[which_dict][entry]
|
||||||
|
@ -221,6 +221,7 @@ class EvalBoolOrOp(object):
|
||||||
right = self.value[2].eval()
|
right = self.value[2].eval()
|
||||||
return left or right
|
return left or right
|
||||||
|
|
||||||
|
|
||||||
_parser = None
|
_parser = None
|
||||||
_vars = {}
|
_vars = {}
|
||||||
|
|
||||||
|
|
|
@ -298,6 +298,7 @@ class FakeHostState(host_manager.HostState):
|
||||||
for (key, val) in attribute_dict.items():
|
for (key, val) in attribute_dict.items():
|
||||||
setattr(self, key, val)
|
setattr(self, key, val)
|
||||||
|
|
||||||
|
|
||||||
FAKE_HOST_STRING_1 = 'openstack@BackendA#PoolX'
|
FAKE_HOST_STRING_1 = 'openstack@BackendA#PoolX'
|
||||||
FAKE_HOST_STRING_2 = 'openstack@BackendB#PoolY'
|
FAKE_HOST_STRING_2 = 'openstack@BackendB#PoolY'
|
||||||
FAKE_HOST_STRING_3 = 'openstack@BackendC#PoolZ'
|
FAKE_HOST_STRING_3 = 'openstack@BackendC#PoolZ'
|
||||||
|
|
|
@ -1573,6 +1573,7 @@ class FakeEMCShareDriver(object):
|
||||||
self.configuration.emc_nas_password = FakeData.emc_nas_password
|
self.configuration.emc_nas_password = FakeData.emc_nas_password
|
||||||
self.configuration.share_backend_name = FakeData.share_backend_name
|
self.configuration.share_backend_name = FakeData.share_backend_name
|
||||||
|
|
||||||
|
|
||||||
CIFS_SHARE = fake_share.fake_share(
|
CIFS_SHARE = fake_share.fake_share(
|
||||||
id=FakeData.share_id,
|
id=FakeData.share_id,
|
||||||
name=FakeData.share_name,
|
name=FakeData.share_name,
|
||||||
|
|
|
@ -31,5 +31,6 @@ def load_yaml(file_name):
|
||||||
LOG.debug('Loaded yaml mock objects from %s.', yaml_file)
|
LOG.debug('Loaded yaml mock objects from %s.', yaml_file)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
patch_find_ports_by_mtu = mock.patch('manila.share.drivers.dell_emc.plugins.'
|
patch_find_ports_by_mtu = mock.patch('manila.share.drivers.dell_emc.plugins.'
|
||||||
'unity.utils.find_ports_by_mtu')
|
'unity.utils.find_ports_by_mtu')
|
||||||
|
|
|
@ -78,6 +78,7 @@ class FakeConnection(base.StorageConnection):
|
||||||
def teardown_server(self, server_details, security_services=None):
|
def teardown_server(self, server_details, security_services=None):
|
||||||
"""Teardown share server."""
|
"""Teardown share server."""
|
||||||
|
|
||||||
|
|
||||||
FAKE_BACKEND = 'fake_backend'
|
FAKE_BACKEND = 'fake_backend'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -268,4 +268,5 @@ SNAPSHOT_INSTANCE = {
|
||||||
class FakeException(Exception):
|
class FakeException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
FAKE_EXCEPTION = FakeException("Fake exception for testing.")
|
FAKE_EXCEPTION = FakeException("Fake exception for testing.")
|
||||||
|
|
|
@ -67,5 +67,6 @@ def main(argv):
|
||||||
install.install_dependencies()
|
install.install_dependencies()
|
||||||
print_help(venv, root)
|
print_help(venv, root)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main(sys.argv)
|
main(sys.argv)
|
||||||
|
|
3
tox.ini
3
tox.ini
|
@ -135,9 +135,8 @@ commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs}
|
||||||
# W504 line break after binary operator
|
# W504 line break after binary operator
|
||||||
# W605 invalid escape sequence
|
# W605 invalid escape sequence
|
||||||
# E741 ambiguous variable name 'l'
|
# E741 ambiguous variable name 'l'
|
||||||
# E305 expected 2 blank lines after class or function definition, found 1
|
|
||||||
# E731 do not assign a lambda expression, use a def
|
# E731 do not assign a lambda expression, use a def
|
||||||
ignore = E123,E305,E402,E731,E741,W503,W504,W605
|
ignore = E123,E402,E731,E741,W503,W504,W605
|
||||||
builtins = _
|
builtins = _
|
||||||
# [H106] Don't put vim configuration in source files.
|
# [H106] Don't put vim configuration in source files.
|
||||||
# [H203] Use assertIs(Not)None to check for None.
|
# [H203] Use assertIs(Not)None to check for None.
|
||||||
|
|
Loading…
Reference in New Issue