override_defaults phase was added to devstack in [1]
but documentation was pending. This patch adds the
same. For history around override_defaults, one can
refer to the mail thread [2]
Also fixes a small typo
[1]: https://review.openstack.org/#/c/167933/
[2]: http://lists.openstack.org/pipermail/openstack-dev/2015-March/059621.html
Change-Id: I1b58ca0ce0e4b85a1dbd710b4c426606fd4dcf45
| ... | ... |
@@ -19,7 +19,16 @@ DevStack supports a standard mechanism for including plugins from |
| 19 | 19 |
external repositories. The plugin interface assumes the following: |
| 20 | 20 |
|
| 21 | 21 |
An external git repository that includes a ``devstack/`` top level |
| 22 |
-directory. Inside this directory there can be 2 files. |
|
| 22 |
+directory. Inside this directory there can be 3 files. |
|
| 23 |
+ |
|
| 24 |
+- ``override_defaults`` - a file containing global variables that |
|
| 25 |
+ will be sourced before the lib/* files. This allows the plugin |
|
| 26 |
+ to override the defaults that are otherwise set in the lib/* |
|
| 27 |
+ files. |
|
| 28 |
+ |
|
| 29 |
+ For example, override_defaults may export CINDER_ENABLED_BACKENDS |
|
| 30 |
+ to include the plugin-specific storage backend and thus be able |
|
| 31 |
+ to override the default lvm only storage backend for Cinder. |
|
| 23 | 32 |
|
| 24 | 33 |
- ``settings`` - a file containing global variables that will be |
| 25 | 34 |
sourced very early in the process. This is helpful if other plugins |
| ... | ... |
@@ -38,7 +47,7 @@ directory. Inside this directory there can be 2 files. |
| 38 | 38 |
|
| 39 | 39 |
- ``plugin.sh`` - the actual plugin. It is executed by devstack at |
| 40 | 40 |
well defined points during a ``stack.sh`` run. The plugin.sh |
| 41 |
- internal structure is discussed bellow. |
|
| 41 |
+ internal structure is discussed below. |
|
| 42 | 42 |
|
| 43 | 43 |
|
| 44 | 44 |
Plugins are registered by adding the following to the localrc section |
| ... | ... |
@@ -14,10 +14,13 @@ The scripts are sourced at the beginning of each script that calls them. The |
| 14 | 14 |
entire `stack.sh` variable space is available. The scripts are |
| 15 | 15 |
sourced with one or more arguments, the first of which defines the hook phase: |
| 16 | 16 |
|
| 17 |
- source | stack | unstack | clean |
|
| 17 |
+ override_defaults | source | stack | unstack | clean |
|
| 18 | 18 |
|
| 19 |
- source: always called first in any of the scripts, used to set the |
|
| 20 |
- initial defaults in a lib/* script or similar |
|
| 19 |
+ override_defaults: always called first in any of the scripts, used to |
|
| 20 |
+ override defaults (if need be) that are otherwise set in lib/* scripts |
|
| 21 |
+ |
|
| 22 |
+ source: called by stack.sh. Used to set the initial defaults in a lib/* |
|
| 23 |
+ script or similar |
|
| 21 | 24 |
|
| 22 | 25 |
stack: called by stack.sh. There are four possible values for |
| 23 | 26 |
the second arg to distinguish the phase stack.sh is in: |