Enable hacking rule E265

E265 is block comment should start with '# '

Closes-Bug: #1391787

Change-Id: I8f0e142bd14fd201da3b8c39501f9d858a5b051b
This commit is contained in:
jiangfei 2014-11-12 18:21:43 +08:00
parent aca4eeb231
commit 63ab84ccac
12 changed files with 24 additions and 25 deletions

View File

@ -234,7 +234,7 @@ class BaseImageService(object):
"""
sent_service_image_meta = service_utils.translate_to_glance(image_meta)
#TODO(ghe): Allow copy-from or location headers Bug #1199532
# TODO(ghe): Allow copy-from or location headers Bug #1199532
if data:
sent_service_image_meta['data'] = data
@ -265,7 +265,7 @@ class BaseImageService(object):
if data:
image_meta['data'] = data
#NOTE(bcwaldon): id is not an editable field, but it is likely to be
# NOTE(bcwaldon): id is not an editable field, but it is likely to be
# passed in by calling code. Let's be nice and ignore it.
image_meta.pop('id', None)

View File

@ -30,7 +30,7 @@ def getcallargs(function, *args, **kwargs):
keyed_args.update(kwargs)
#NOTE(alaski) the implicit 'self' or 'cls' argument shows up in
# NOTE(alaski) the implicit 'self' or 'cls' argument shows up in
# argnames but not in args or kwargs. Uses 'in' rather than '==' because
# some tests use 'self2'.
if 'self' in argnames[0] or 'cls' == argnames[0]:

View File

@ -409,7 +409,7 @@ def mkfs(fs, path, label=None):
args = ['mkswap']
else:
args = ['mkfs', '-t', fs]
#add -F to force no interactive execute on non-block device.
# add -F to force no interactive execute on non-block device.
if fs in ('ext3', 'ext4'):
args.extend(['-F'])
if label:

View File

@ -28,7 +28,7 @@ import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
# commands auto generated by Alembic - please adjust!
op.create_table(
'conductors',
sa.Column('created_at', sa.DateTime(), nullable=True),
@ -98,7 +98,7 @@ def upgrade():
mysql_ENGINE='InnoDB',
mysql_DEFAULT_CHARSET='UTF8'
)
### end Alembic commands ###
# end Alembic commands
def downgrade():

View File

@ -27,14 +27,14 @@ import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
# commands auto generated by Alembic - please adjust
op.add_column('nodes', sa.Column('instance_info',
sa.Text(),
nullable=True))
### end Alembic commands ###
# end Alembic commands
def downgrade():
### commands auto generated by Alembic - please adjust! ###
# commands auto generated by Alembic - please adjust
op.drop_column('nodes', 'instance_info')
### end Alembic commands ###
# end Alembic commands

View File

@ -65,7 +65,7 @@ def _update_ipmi_properties(task):
node = task.node
info = node.driver_info
#updating ipmi credentials
# updating ipmi credentials
info['ipmi_address'] = info['ilo_address']
info['ipmi_username'] = info['ilo_username']
info['ipmi_password'] = info['ilo_password']
@ -73,7 +73,7 @@ def _update_ipmi_properties(task):
if 'console_port' in info:
info['ipmi_terminal_port'] = info['console_port']
#saving ipmi credentials to task object
# saving ipmi credentials to task object
task.node.driver_info = info

View File

@ -87,7 +87,7 @@ class ImageCache(object):
"""
img_download_lock_name = 'download-image'
if self.master_dir is None:
#NOTE(ghe): We don't share images between instances/hosts
# NOTE(ghe): We don't share images between instances/hosts
if not CONF.parallel_image_downloads:
with lockutils.lock(img_download_lock_name, 'ironic-'):
_fetch(ctx, uuid, dest_path, self._image_service,
@ -96,7 +96,7 @@ class ImageCache(object):
_fetch(ctx, uuid, dest_path, self._image_service, force_raw)
return
#TODO(ghe): have hard links and counts the same behaviour in all fs
# TODO(ghe): have hard links and counts the same behaviour in all fs
master_file_name = service_utils.parse_image_ref(uuid)[0]
master_path = os.path.join(self.master_dir, master_file_name)
@ -145,8 +145,8 @@ class ImageCache(object):
:param force_raw: boolean value, whether to convert the image to raw
format
"""
#TODO(ghe): timeout and retry for downloads
#TODO(ghe): logging when image cannot be created
# TODO(ghe): timeout and retry for downloads
# TODO(ghe): logging when image cannot be created
tmp_dir = tempfile.mkdtemp(dir=self.master_dir)
tmp_path = os.path.join(tmp_dir, uuid)
try:

View File

@ -68,14 +68,14 @@ class TestListNodes(api_base.FunctionalTest):
self.addCleanup(p.stop)
def _create_association_test_nodes(self):
#create some unassociated nodes
# create some unassociated nodes
unassociated_nodes = []
for id in range(3):
node = obj_utils.create_test_node(self.context,
uuid=utils.generate_uuid())
unassociated_nodes.append(node.uuid)
#created some associated nodes
# created some associated nodes
associated_nodes = []
for id in range(4):
node = obj_utils.create_test_node(

View File

@ -1009,7 +1009,7 @@ class IPMIToolDriverTestCase(db_base.DbTestCase):
@mock.patch.object(ipmi, '_power_on', autospec=False)
def test_reboot_ok(self, mock_on, mock_off):
manager = mock.MagicMock()
#NOTE(rloo): if autospec is True, then manager.mock_calls is empty
# NOTE(rloo): if autospec is True, then manager.mock_calls is empty
mock_on.return_value = states.POWER_ON
manager.attach_mock(mock_off, 'power_off')
manager.attach_mock(mock_on, 'power_on')
@ -1026,7 +1026,7 @@ class IPMIToolDriverTestCase(db_base.DbTestCase):
@mock.patch.object(ipmi, '_power_on', autospec=False)
def test_reboot_fail(self, mock_on, mock_off):
manager = mock.MagicMock()
#NOTE(rloo): if autospec is True, then manager.mock_calls is empty
# NOTE(rloo): if autospec is True, then manager.mock_calls is empty
mock_on.return_value = states.ERROR
manager.attach_mock(mock_off, 'power_off')
manager.attach_mock(mock_on, 'power_on')

View File

@ -25,12 +25,12 @@ class StubGlanceClient(object):
_images = images or []
map(lambda image: self.create(**image), _images)
#NOTE(bcwaldon): HACK to get client.images.* to work
# NOTE(bcwaldon): HACK to get client.images.* to work
self.images = lambda: None
for fn in ('list', 'get', 'data', 'create', 'update', 'delete'):
setattr(self.images, fn, getattr(self, fn))
#TODO(bcwaldon): implement filters
# TODO(bcwaldon): implement filters
def list(self, filters=None, marker=None, limit=30):
if marker is None:
index = 0

View File

@ -489,7 +489,7 @@ class TestGlanceImageService(base.TestCase):
stub_service.download(image_id, writer)
def test_download_file_url(self):
#NOTE: only in v2 API
# NOTE: only in v2 API
class MyGlanceStubClient(stubs.StubGlanceClient):
"""A client that returns a file url."""

View File

@ -46,8 +46,7 @@ commands = {posargs}
[flake8]
# E711: ignored because it is normal to use "column == None" in sqlalchemy
# TODO(yuriyz): Analyze or fix the warnings blacklisted below
ignore = E12,E265,E711
ignore = E12,E711
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova*
max-complexity=17