Public bug reported: Description =========== Hacking check check_config_option_in_central_place does not check anything. It is because of `not` keyword in https://github.com/openstack/nova/blob/master/nova/hacking/checks.py#L660 , which causes every file that is checked and is not in nova/conf directory to be omitted.
Steps to reproduce ================== 1. Add dummy config opt to random file, for example: diff --git a/nova/cmd/api.py b/nova/cmd/api.py index d8c76ca..d5fe906 100644 --- a/nova/cmd/api.py +++ b/nova/cmd/api.py @@ -22,6 +22,7 @@ Starts both the EC2 and OpenStack APIs in separate greenthreads. import sys +from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr import six @@ -39,6 +40,8 @@ CONF = nova.conf.CONF def main(): + new_opt = cfg.StrOpt('test_opt', default='test', + help='test_opt description') config.parse_args(sys.argv) logging.setup(CONF, "nova") utils.monkey_patch() 2. Run tox with command: $ tox -epep8 3. Observe as no N342 checking error is reported. Expected result =============== N342 checking error is reported Actual result ============= No N342 checking error is reported. Environment =========== Nova master branch, commit 15e536518ae1a366c8a8b15d9183072050e4b6f2 (newest when reporting this bug). Logs & Configs ============== No need for logs. ** Affects: nova Importance: Undecided Assignee: Maciej Szankin (mszankin) Status: In Progress ** Changed in: nova Assignee: (unassigned) => Maciej Szankin (mszankin) -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1613411 Title: check_config_option_in_central_place does not check anything Status in OpenStack Compute (nova): In Progress Bug description: Description =========== Hacking check check_config_option_in_central_place does not check anything. It is because of `not` keyword in https://github.com/openstack/nova/blob/master/nova/hacking/checks.py#L660 , which causes every file that is checked and is not in nova/conf directory to be omitted. Steps to reproduce ================== 1. Add dummy config opt to random file, for example: diff --git a/nova/cmd/api.py b/nova/cmd/api.py index d8c76ca..d5fe906 100644 --- a/nova/cmd/api.py +++ b/nova/cmd/api.py @@ -22,6 +22,7 @@ Starts both the EC2 and OpenStack APIs in separate greenthreads. import sys +from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr import six @@ -39,6 +40,8 @@ CONF = nova.conf.CONF def main(): + new_opt = cfg.StrOpt('test_opt', default='test', + help='test_opt description') config.parse_args(sys.argv) logging.setup(CONF, "nova") utils.monkey_patch() 2. Run tox with command: $ tox -epep8 3. Observe as no N342 checking error is reported. Expected result =============== N342 checking error is reported Actual result ============= No N342 checking error is reported. Environment =========== Nova master branch, commit 15e536518ae1a366c8a8b15d9183072050e4b6f2 (newest when reporting this bug). Logs & Configs ============== No need for logs. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1613411/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp