From 5794b857b4367278a3c1fb1e897629ba739bb994 Mon Sep 17 00:00:00 2001 From: EdLeafe Date: Thu, 6 Sep 2018 18:44:17 +0000 Subject: [PATCH] Rename files to remove 'placement' When part of Nova, many files were named in such a way as to indicate that they were separate from the nova files that did the same thing. Now that that distinction is no longer needed, we can rename them to sound more natural. Additionally, references to these file names in other parts of the code have been updated. Change-Id: Id4439b4af827b64bbac213085ac74d1283c96db0 --- doc/source/conf.py | 2 +- doc/source/configuration/index.rst | 8 ++++---- .../configuration/{placement-policy.rst => policy.rst} | 4 ++-- .../{sample-placement-policy.rst => sample-policy.rst} | 0 doc/source/contributor/index.rst | 8 ++++---- etc/placement/README-policy.yaml.txt | 2 +- ...cement-policy-generator.conf => policy-generator.conf} | 0 placement/conf/placement.py | 4 ++-- .../{029_placement_aggregates.py => 029_aggregates.py} | 0 .../{043_placement_consumers.py => 043_consumers.py} | 0 ...nt_add_projects_users.py => 044_add_projects_users.py} | 0 .../functional/{test_placement_api.py => test_api.py} | 0 tox.ini | 4 ++-- 13 files changed, 16 insertions(+), 16 deletions(-) rename doc/source/configuration/{placement-policy.rst => policy.rst} (62%) rename doc/source/configuration/{sample-placement-policy.rst => sample-policy.rst} (100%) rename etc/placement/{placement-policy-generator.conf => policy-generator.conf} (100%) rename placement/db/sqlalchemy/api_migrations/migrate_repo/versions/{029_placement_aggregates.py => 029_aggregates.py} (100%) rename placement/db/sqlalchemy/api_migrations/migrate_repo/versions/{043_placement_consumers.py => 043_consumers.py} (100%) rename placement/db/sqlalchemy/api_migrations/migrate_repo/versions/{044_placement_add_projects_users.py => 044_add_projects_users.py} (100%) rename placement/tests/functional/{test_placement_api.py => test_api.py} (100%) diff --git a/doc/source/conf.py b/doc/source/conf.py index ecdd83cc1..26fb3ebd6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -58,7 +58,7 @@ bug_project = 'nova' bug_tag = 'docs' policy_generator_config_file = [ - ('../../etc/placement/placement-policy-generator.conf', + ('../../etc/placement/policy-generator.conf', '_static/placement') ] diff --git a/doc/source/configuration/index.rst b/doc/source/configuration/index.rst index 6ae792b58..5776edb58 100644 --- a/doc/source/configuration/index.rst +++ b/doc/source/configuration/index.rst @@ -25,10 +25,10 @@ Policy Placement, like most OpenStack projects, uses a policy language to restrict permissions on REST API actions. -* :doc:`Policy Reference `: A complete +* :doc:`Policy Reference `: A complete reference of all policy points in placement and what they impact. -* :doc:`Sample Policy File `: A sample +* :doc:`Sample Policy File `: A sample placement policy file with inline documentation. @@ -38,8 +38,8 @@ permissions on REST API actions. .. toctree:: :hidden: - placement-policy - sample-placement-policy + policy + sample-policy .. TODO(efried):: get these working config diff --git a/doc/source/configuration/placement-policy.rst b/doc/source/configuration/policy.rst similarity index 62% rename from doc/source/configuration/placement-policy.rst rename to doc/source/configuration/policy.rst index dd93d21e3..08d250eb4 100644 --- a/doc/source/configuration/placement-policy.rst +++ b/doc/source/configuration/policy.rst @@ -4,7 +4,7 @@ Placement Policies The following is an overview of all available policies in Placement. For a sample configuration file, refer to -:doc:`/configuration/sample-placement-policy`. +:doc:`/configuration/sample-policy`. .. show-policy:: - :config-file: etc/placement/placement-policy-generator.conf + :config-file: etc/placement/policy-generator.conf diff --git a/doc/source/configuration/sample-placement-policy.rst b/doc/source/configuration/sample-policy.rst similarity index 100% rename from doc/source/configuration/sample-placement-policy.rst rename to doc/source/configuration/sample-policy.rst diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst index 5d4f0054f..1da6bffae 100644 --- a/doc/source/contributor/index.rst +++ b/doc/source/contributor/index.rst @@ -318,21 +318,21 @@ number of tests it makes sense to have more YAML files with fewer tests, divided up by the arc of API interaction that they test. The gabbi tests are integrated into the functional tox target, loaded via -``nova/tests/functional/api/openstack/placement/test_placement_api.py``. If you +``nova/tests/functional/api/openstack/placement/test_api.py``. If you want to run just the gabbi tests one way to do so is:: - tox -efunctional test_placement_api + tox -efunctional test_api If you want to run just one yaml file (in this example ``inventory.yaml``):: - tox -efunctional placement_api.inventory + tox -efunctional api.inventory It is also possible to run just one test from within one file. When you do this every test prior to the one you asked for will also be run. This is because the YAML represents a sequence of dependent requests. Select the test by using the name in the yaml file, replacing space with ``_``:: - tox -efunctional placement_api.inventory_post_new_ipv4_address_inventory + tox -efunctional api.inventory_post_new_ipv4_address_inventory .. note:: ``tox.ini`` in the nova repository is configured by a ``group_regex`` so that each gabbi YAML is considered a group. Thus, all tests in the diff --git a/etc/placement/README-policy.yaml.txt b/etc/placement/README-policy.yaml.txt index 7599f8071..a975e13bf 100644 --- a/etc/placement/README-policy.yaml.txt +++ b/etc/placement/README-policy.yaml.txt @@ -21,4 +21,4 @@ from the top level of the nova directory: For a pre-generated example of the latest placement policy.yaml, see: - https://docs.openstack.org/nova/latest/configuration/sample-placement-policy.html + https://docs.openstack.org/nova/latest/configuration/sample-policy.html diff --git a/etc/placement/placement-policy-generator.conf b/etc/placement/policy-generator.conf similarity index 100% rename from etc/placement/placement-policy-generator.conf rename to etc/placement/policy-generator.conf diff --git a/placement/conf/placement.py b/placement/conf/placement.py index b19640c67..cd04b6baf 100644 --- a/placement/conf/placement.py +++ b/placement/conf/placement.py @@ -42,8 +42,8 @@ is determined. cfg.StrOpt( 'policy_file', # This default matches what is in - # etc/nova/placement-policy-generator.conf - default='placement-policy.yaml', + # etc/nova/policy-generator.conf + default='policy.yaml', help='The file that defines placement policies. This can be an ' 'absolute path or relative to the configuration file.'), cfg.StrOpt( diff --git a/placement/db/sqlalchemy/api_migrations/migrate_repo/versions/029_placement_aggregates.py b/placement/db/sqlalchemy/api_migrations/migrate_repo/versions/029_aggregates.py similarity index 100% rename from placement/db/sqlalchemy/api_migrations/migrate_repo/versions/029_placement_aggregates.py rename to placement/db/sqlalchemy/api_migrations/migrate_repo/versions/029_aggregates.py diff --git a/placement/db/sqlalchemy/api_migrations/migrate_repo/versions/043_placement_consumers.py b/placement/db/sqlalchemy/api_migrations/migrate_repo/versions/043_consumers.py similarity index 100% rename from placement/db/sqlalchemy/api_migrations/migrate_repo/versions/043_placement_consumers.py rename to placement/db/sqlalchemy/api_migrations/migrate_repo/versions/043_consumers.py diff --git a/placement/db/sqlalchemy/api_migrations/migrate_repo/versions/044_placement_add_projects_users.py b/placement/db/sqlalchemy/api_migrations/migrate_repo/versions/044_add_projects_users.py similarity index 100% rename from placement/db/sqlalchemy/api_migrations/migrate_repo/versions/044_placement_add_projects_users.py rename to placement/db/sqlalchemy/api_migrations/migrate_repo/versions/044_add_projects_users.py diff --git a/placement/tests/functional/test_placement_api.py b/placement/tests/functional/test_api.py similarity index 100% rename from placement/tests/functional/test_placement_api.py rename to placement/tests/functional/test_api.py diff --git a/tox.ini b/tox.ini index c8bed1dc6..13531bee6 100644 --- a/tox.ini +++ b/tox.ini @@ -80,7 +80,7 @@ commands = # special way. See the following for more details. # http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests # https://gabbi.readthedocs.io/en/latest/#purpose - stestr --test-path=./placement/tests/functional --group_regex=placement\.tests\.functional\.test_placement_api(?:\.|_)([^_]+) run {posargs} + stestr --test-path=./placement/tests/functional --group_regex=placement\.tests\.functional\.test_api(?:\.|_)([^_]+) run {posargs} stestr slowest # TODO(gcb) Merge this into [testenv:functional] when functional tests are gating @@ -108,7 +108,7 @@ commands = [testenv:genpolicy] envdir = {toxworkdir}/shared commands = - oslopolicy-sample-generator --config-file=etc/placement/placement-policy-generator.conf + oslopolicy-sample-generator --config-file=etc/placement/policy-generator.conf [testenv:cover] # TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]