From 2314d4dc9d8aef74138cea08d367d016113cc687 Mon Sep 17 00:00:00 2001 From: Dolph Mathews Date: Tue, 14 Jan 2014 11:45:56 -0600 Subject: [PATCH] revise example extension directory structure - used the syntax employed by the 'tree' tool, which is not so heavy on whitespace, and should render much better as a literal example on the web - merged the 'backends' example into the general example, since having at least one backend is common - flushed out an example 'migrate_repo' directory Change-Id: Idba9555f93caf2142e0d1becdc1afb0af50b94de --- doc/source/extension_development.rst | 50 +++++++++++----------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/doc/source/extension_development.rst b/doc/source/extension_development.rst index 156cff6c81..dcf9917bab 100644 --- a/doc/source/extension_development.rst +++ b/doc/source/extension_development.rst @@ -23,25 +23,25 @@ Extension code base in the ``keystone/contrib/example`` folder. - All Extensions must be created in the ``keystone/contrib`` folder. - The new Extension code must be contained in a new folder under ``contrib``. -- Whenever possible an Extension should follow the following structure - convention:: +- Whenever possible an Extension should follow the following directory + structure convention:: - keystone - \\\ contrib - \\\ my_extension - \\\ backends (optional) - - \\\ migrate_repo (optional) - - \\\ __init__.py (mandatory) - - \\\ configuration.rst (mandatory) - - \\\ core.py (mandatory) - - \\\ controllers.py (mandatory for API Extension) - - \\\ routers.py (mandatory for API Extension) + keystone/contrib/ + └── my_extension +    ├── backends (optional) +    │   ├── __init__.py (mandatory) +    │   └── sql.py (optional) +    │   └── kvs.py (optional) +    ├── migrate_repo (optional) +    │   ├── __init__.py (mandatory) +    │   ├── migrate.cfg (mandatory) +    │   └── versions (mandatory) + │      ├── 001_create_tables.py (mandatory) + │      └── __init__.py (mandatory) +    ├── __init__.py (mandatory) +    ├── core.py (mandatory) +    ├── controllers.py (mandatory for API Extension) +    └── routers.py (mandatory for API Extension) - If the Extension implements an API Extension the ``controllers.py`` and ``routers.py`` must be present and correctly handle the API Extension @@ -187,18 +187,8 @@ Backends ======== The ``backends`` folder provides the model implementations for the different -backends supported by the Extension. The folder structure must be the -following:: - - keystone - \\\ contrib - \\\ my_extension - \\\ backends - \\\ __init__.py (required) - - \\\ sql.py (optional) - - \\\ kvs.py (optional) +backends supported by the Extension. See General above for an example directory +structure. If a SQL backend is provided, in the ``sql.py`` backend implementation it is mandatory to define the new table(s) that the Extension introduces and the