Browse Source

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
changes/34/716534/1
Andreas Jaeger 1 year ago
parent
commit
8098045f2a
12 changed files with 16 additions and 6 deletions
  1. +4
    -3
      manila/api/common.py
  2. +1
    -0
      manila/api/v1/limits.py
  3. +1
    -0
      manila/cmd/status.py
  4. +1
    -0
      manila/db/sqlalchemy/query.py
  5. +2
    -1
      manila/scheduler/evaluator/evaluator.py
  6. +1
    -0
      manila/tests/scheduler/fakes.py
  7. +1
    -0
      manila/tests/share/drivers/dell_emc/common/enas/fakes.py
  8. +1
    -0
      manila/tests/share/drivers/dell_emc/plugins/unity/utils.py
  9. +1
    -0
      manila/tests/share/drivers/dell_emc/test_driver.py
  10. +1
    -0
      manila/tests/share/drivers/hpe/test_hpe_3par_constants.py
  11. +1
    -0
      tools/install_venv.py
  12. +1
    -2
      tox.ini

+ 4
- 3
manila/api/common.py View File

@ -334,6 +334,7 @@ def validate_common_name(access):
exc_str = _('Invalid CN (common name). Must be 1-64 chars long.')
raise webob.exc.HTTPBadRequest(explanation=exc_str)
'''
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):
sole_periods_spaces_re = '[\s|\.]+$'
valid_username_re = '.[^\"\/\\\[\]\:\;\|\=\,\+\*\?\<\>]{3,254}$'
sole_periods_spaces_re = r'[\s|\.]+$'
valid_username_re = r'.[^\"\/\\\[\]\:\;\|\=\,\+\*\?\<\>]{3,254}$'
username = access
if re.match(sole_periods_spaces_re, username):
@ -355,7 +356,7 @@ def validate_username(access):
if not re.match(valid_username_re, username):
exc_str = ('Invalid user or group name. Must be 4-255 characters '
'and consist of alphanumeric characters and '
'exclude special characters "/\[]:;|=,+*?<>')
'exclude special characters "/\\[]:;|=,+*?<>')
raise webob.exc.HTTPBadRequest(explanation=exc_str)


+ 1
- 0
manila/api/v1/limits.py View File

@ -170,6 +170,7 @@ class Limit(object):
"resetTime": int(self.next_request or self._get_time()),
}
# "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.)


+ 1
- 0
manila/cmd/status.py View File

@ -49,5 +49,6 @@ def main():
return upgradecheck.main(
cfg.CONF, project='manila', upgrade_command=Checks())
if __name__ == '__main__':
sys.exit(main())

+ 1
- 0
manila/db/sqlalchemy/query.py View File

@ -36,5 +36,6 @@ def get_maker(engine, autocommit=True, expire_on_commit=False):
expire_on_commit=expire_on_commit,
query_cls=Query)
# NOTE(uglide): Monkey patch oslo_db get_maker() function to use custom Query
orm.get_maker = get_maker

+ 2
- 1
manila/scheduler/evaluator/evaluator.py View File

@ -41,7 +41,7 @@ class EvalConstant(object):
def eval(self):
result = self.value
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('.')
try:
result = _vars[which_dict][entry]
@ -221,6 +221,7 @@ class EvalBoolOrOp(object):
right = self.value[2].eval()
return left or right
_parser = None
_vars = {}


+ 1
- 0
manila/tests/scheduler/fakes.py View File

@ -298,6 +298,7 @@ class FakeHostState(host_manager.HostState):
for (key, val) in attribute_dict.items():
setattr(self, key, val)
FAKE_HOST_STRING_1 = 'openstack@BackendA#PoolX'
FAKE_HOST_STRING_2 = 'openstack@BackendB#PoolY'
FAKE_HOST_STRING_3 = 'openstack@BackendC#PoolZ'


+ 1
- 0
manila/tests/share/drivers/dell_emc/common/enas/fakes.py View File

@ -1573,6 +1573,7 @@ class FakeEMCShareDriver(object):
self.configuration.emc_nas_password = FakeData.emc_nas_password
self.configuration.share_backend_name = FakeData.share_backend_name
CIFS_SHARE = fake_share.fake_share(
id=FakeData.share_id,
name=FakeData.share_name,


+ 1
- 0
manila/tests/share/drivers/dell_emc/plugins/unity/utils.py View File

@ -31,5 +31,6 @@ def load_yaml(file_name):
LOG.debug('Loaded yaml mock objects from %s.', yaml_file)
return res
patch_find_ports_by_mtu = mock.patch('manila.share.drivers.dell_emc.plugins.'
'unity.utils.find_ports_by_mtu')

+ 1
- 0
manila/tests/share/drivers/dell_emc/test_driver.py View File

@ -78,6 +78,7 @@ class FakeConnection(base.StorageConnection):
def teardown_server(self, server_details, security_services=None):
"""Teardown share server."""
FAKE_BACKEND = 'fake_backend'


+ 1
- 0
manila/tests/share/drivers/hpe/test_hpe_3par_constants.py View File

@ -268,4 +268,5 @@ SNAPSHOT_INSTANCE = {
class FakeException(Exception):
pass
FAKE_EXCEPTION = FakeException("Fake exception for testing.")

+ 1
- 0
tools/install_venv.py View File

@ -67,5 +67,6 @@ def main(argv):
install.install_dependencies()
print_help(venv, root)
if __name__ == '__main__':
main(sys.argv)

+ 1
- 2
tox.ini View File

@ -135,9 +135,8 @@ commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs}
# W504 line break after binary operator
# W605 invalid escape sequence
# 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
ignore = E123,E305,E402,E731,E741,W503,W504,W605
ignore = E123,E402,E731,E741,W503,W504,W605
builtins = _
# [H106] Don't put vim configuration in source files.
# [H203] Use assertIs(Not)None to check for None.


Loading…
Cancel
Save