diff --git a/create-and-deploy-charms.rst b/create-and-deploy-charms.rst index 1b1258efa162e460a234ee33544e4a9dabef56df..485aac8b11611da0d730e9a370074849b49177cc 100644 --- a/create-and-deploy-charms.rst +++ b/create-and-deploy-charms.rst @@ -182,6 +182,11 @@ Wordpress Charm Development Tutorial This function uses the ``@hook`` decorator, which associates the decorated function to a `Charm Lifecycle event <https://jaas.ai/docs/charm-hooks>`_. + Add also the missing imports: + + .. code-block:: python + + from charms.reactive import when, when_not, set_flag, hook 2. Position yourself in the wordpress directory and from the command line execute these commands: @@ -293,12 +298,23 @@ Configure the Wordpress application according to https://help.ubuntu.com/lts/ser status_set('active', 'Ready') - This function retrieves informations from the mysql unit regarding the account and database that was created when + This function retrieves information from the mysql unit regarding the account and database that was created when the *juju add-relation mysql wordpress* command was executed. Then, writes these information into the */etc/wordpress/config-default.php* file using the Jinja2 templating engine. -5. Build and deploy the wordpress charm with the last modifications: +5. Add the missing imports: + + .. code-block:: python + + from charms.reactive import when, when_not, set_flag, hook, when_all + from charmhelpers.core.hookenv import status_set, relation_get, log + from charmhelpers.core.host import write_file, service_restart + from charmhelpers.core.templating import render + import charms.apt + import subprocess + +6. Build and deploy the wordpress charm with the last modifications: .. code-block:: bash