diff --git a/HACKING.rst b/HACKING.rst index 0a6119d855cf..7aa25a1d8868 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -22,6 +22,8 @@ Nova Specific Commandments - [N313] capitalize help string Config parameter help strings should have a capitalized first letter - [N314] vim configuration should not be kept in source files. +- [N315] We do not use @authors tags in source files. We have git to track + authorship. Creating Unit Tests ------------------- diff --git a/nova/api/openstack/compute/contrib/user_quotas.py b/nova/api/openstack/compute/contrib/user_quotas.py index f6463a5889e1..319e30c3ac99 100644 --- a/nova/api/openstack/compute/contrib/user_quotas.py +++ b/nova/api/openstack/compute/contrib/user_quotas.py @@ -1,5 +1,4 @@ # Copyright 2013 OpenStack Foundation -# Author: Yingjun Li # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/nova/api/validator.py b/nova/api/validator.py index 7fec60d2e55e..d15c7c987cad 100644 --- a/nova/api/validator.py +++ b/nova/api/validator.py @@ -1,5 +1,4 @@ # Copyright 2011 Cloudscaling, Inc. -# Author: Matthew Hooker # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/nova/compute/monitors/__init__.py b/nova/compute/monitors/__init__.py index 30ad4e173e17..3d55012309a2 100644 --- a/nova/compute/monitors/__init__.py +++ b/nova/compute/monitors/__init__.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Shane Wang, Intel Corporation. """ Resource monitor API specification. diff --git a/nova/compute/monitors/cpu_monitor.py b/nova/compute/monitors/cpu_monitor.py index 083deefc28c3..a4d563f1e4aa 100644 --- a/nova/compute/monitors/cpu_monitor.py +++ b/nova/compute/monitors/cpu_monitor.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Shane Wang, Intel Corporation. """ CPU monitor to retrieve CPU information diff --git a/nova/compute/monitors/virt/__init__.py b/nova/compute/monitors/virt/__init__.py index afe3535b680a..45abc1b83991 100644 --- a/nova/compute/monitors/virt/__init__.py +++ b/nova/compute/monitors/virt/__init__.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Shane Wang, Intel Corporation. from nova.compute.monitors.virt import cpu_monitor diff --git a/nova/compute/monitors/virt/cpu_monitor.py b/nova/compute/monitors/virt/cpu_monitor.py index e4d540be34c1..1cc92db37035 100644 --- a/nova/compute/monitors/virt/cpu_monitor.py +++ b/nova/compute/monitors/virt/cpu_monitor.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Shane Wang, Intel Corporation. """ CPU monitor based on compute driver to retrieve CPU information diff --git a/nova/db/sqlalchemy/migrate_repo/versions/228_add_metrics_in_compute_nodes.py b/nova/db/sqlalchemy/migrate_repo/versions/228_add_metrics_in_compute_nodes.py index 7a9a98a38f1f..7a46db1219d1 100644 --- a/nova/db/sqlalchemy/migrate_repo/versions/228_add_metrics_in_compute_nodes.py +++ b/nova/db/sqlalchemy/migrate_repo/versions/228_add_metrics_in_compute_nodes.py @@ -11,8 +11,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -# @author: Shane Wang, Intel Corporation from sqlalchemy import Column from sqlalchemy import MetaData diff --git a/nova/hacking/checks.py b/nova/hacking/checks.py index d551127f7f56..5176e404a334 100644 --- a/nova/hacking/checks.py +++ b/nova/hacking/checks.py @@ -37,6 +37,7 @@ virt_import_re = re.compile( r"^\s*(?:import|from) nova\.(?:tests\.)?virt\.(\w+)") virt_config_re = re.compile( r"CONF\.import_opt\('.*?', 'nova\.virt\.(\w+)('|.)") +author_tag_re = re.compile("^\s*#\s*@?(a|A)uthor:") def import_no_db_in_virt(logical_line, filename): @@ -146,6 +147,12 @@ def no_vi_headers(physical_line, line_number, lines): return 0, "N314: Don't put vi configuration in source files" +def no_author_tags(physical_line): + if author_tag_re.match(physical_line): + pos = physical_line.find('author') + return pos, "N315: Don't use author tags" + + def factory(register): register(import_no_db_in_virt) register(no_db_session_in_public_api) @@ -154,3 +161,4 @@ def factory(register): register(import_no_virt_driver_config_deps) register(capital_cfg_help) register(no_vi_headers) + register(no_author_tags) diff --git a/nova/network/neutronv2/constants.py b/nova/network/neutronv2/constants.py index fe6ee3b6ddbf..9c76ea454b70 100644 --- a/nova/network/neutronv2/constants.py +++ b/nova/network/neutronv2/constants.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Yong Sheng Gong, UnitedStack Inc. NET_EXTERNAL = 'router:external' PORTBINDING_EXT = 'Port Binding' diff --git a/nova/network/security_group/__init__.py b/nova/network/security_group/__init__.py index 4ed40b67a47f..e69de29bb2d1 100644 --- a/nova/network/security_group/__init__.py +++ b/nova/network/security_group/__init__.py @@ -1,16 +0,0 @@ -# Copyright 2013 Nicira, Inc. -# All Rights Reserved -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# @author: Aaron Rosen, Nicira Networks, Inc. diff --git a/nova/network/security_group/neutron_driver.py b/nova/network/security_group/neutron_driver.py index bd49129052e9..35668606499f 100644 --- a/nova/network/security_group/neutron_driver.py +++ b/nova/network/security_group/neutron_driver.py @@ -12,8 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -# @author: Aaron Rosen, Nicira Networks, Inc. import sys diff --git a/nova/network/security_group/openstack_driver.py b/nova/network/security_group/openstack_driver.py index 44c5a75c90f3..8f29de15196b 100644 --- a/nova/network/security_group/openstack_driver.py +++ b/nova/network/security_group/openstack_driver.py @@ -12,8 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -# @author: Aaron Rosen, Nicira Networks, Inc. from oslo.config import cfg diff --git a/nova/network/security_group/security_group_base.py b/nova/network/security_group/security_group_base.py index 8c0d80189f4a..aaf733d43bb7 100644 --- a/nova/network/security_group/security_group_base.py +++ b/nova/network/security_group/security_group_base.py @@ -16,8 +16,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -# @author: Aaron Rosen, Nicira Networks, Inc. import urllib diff --git a/nova/objects/pci_device.py b/nova/objects/pci_device.py index 9c4419e9554a..2e8a775db387 100644 --- a/nova/objects/pci_device.py +++ b/nova/objects/pci_device.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Yongli He, Intel Corporation. import copy import functools diff --git a/nova/pci/pci_request.py b/nova/pci/pci_request.py index 1a785452b51a..d69097c4fd53 100644 --- a/nova/pci/pci_request.py +++ b/nova/pci/pci_request.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Yongli He, Intel Corporation. """ Example of a PCI alias: pci_alias = '{ diff --git a/nova/tests/api/ec2/test_ec2_validate.py b/nova/tests/api/ec2/test_ec2_validate.py index 187cc692b46a..4f1a11481d2a 100644 --- a/nova/tests/api/ec2/test_ec2_validate.py +++ b/nova/tests/api/ec2/test_ec2_validate.py @@ -1,5 +1,4 @@ # Copyright 2012 Cloudscaling, Inc. -# Author: Joe Gordon # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # diff --git a/nova/tests/api/openstack/compute/contrib/test_neutron_security_groups.py b/nova/tests/api/openstack/compute/contrib/test_neutron_security_groups.py index 7bfb8d76fef7..cdcb1b82c84f 100644 --- a/nova/tests/api/openstack/compute/contrib/test_neutron_security_groups.py +++ b/nova/tests/api/openstack/compute/contrib/test_neutron_security_groups.py @@ -12,8 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -# @author: Aaron Rosen, Nicira Networks, Inc. import uuid diff --git a/nova/tests/api/test_validator.py b/nova/tests/api/test_validator.py index eec09c3a0644..e9e349194ade 100644 --- a/nova/tests/api/test_validator.py +++ b/nova/tests/api/test_validator.py @@ -1,5 +1,4 @@ # Copyright 2011 Cloudscaling, Inc. -# Author: Matthew Hooker # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/nova/tests/image/test_fake.py b/nova/tests/image/test_fake.py index cdd7efdd6e03..9088d58026df 100644 --- a/nova/tests/image/test_fake.py +++ b/nova/tests/image/test_fake.py @@ -1,5 +1,4 @@ # Copyright 2011 OpenStack Foundation -# Author: Soren Hansen # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain diff --git a/nova/tests/pci/test_pci_request.py b/nova/tests/pci/test_pci_request.py index 69b1d9f98a94..f730ba91725b 100644 --- a/nova/tests/pci/test_pci_request.py +++ b/nova/tests/pci/test_pci_request.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# @author: Yongli He, Intel Corporation. """Tests for PCI request.""" diff --git a/nova/tests/test_hacking.py b/nova/tests/test_hacking.py index c0ffa363624a..c32b2141d570 100644 --- a/nova/tests/test_hacking.py +++ b/nova/tests/test_hacking.py @@ -48,3 +48,10 @@ class HackingTestCase(test.NoDBTestCase): "CONF.import_opt('volume_drivers', " "'nova.virt.libvirt.driver', group='libvirt')", "./nova/virt/libvirt/volume.py")) + + def test_virt_driver_imports(self): + self.assertTrue(checks.no_author_tags("# author: jogo")) + self.assertTrue(checks.no_author_tags("# @author: jogo")) + self.assertTrue(checks.no_author_tags("# @Author: jogo")) + self.assertTrue(checks.no_author_tags("# Author: jogo")) + self.assertFalse(checks.no_author_tags("# authorization of this")) diff --git a/nova/tests/virt/libvirt/test_designer.py b/nova/tests/virt/libvirt/test_designer.py index 1aa5ce26116d..649144c0d153 100644 --- a/nova/tests/virt/libvirt/test_designer.py +++ b/nova/tests/virt/libvirt/test_designer.py @@ -1,7 +1,5 @@ # Copyright (C) 2013 eNovance SAS # -# Author: Cyril Roelandt -# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at