16 Commits

Author SHA1 Message Date
Takashi NATSUME
54d3e7096c Fix missing versioned notification examples
Python 3 is used in executing 'tox -e docs' by default currently.
When Python 3 is used, there are some missing notification examples.

In python 3, map function returns an iterator instead of a list,
and importlib.import_module is not executed in the document generation.
So it causes missing versioned notification examples in the nova docs.

This patch fixes it.

Change-Id: Ie4f3f9be0ca7f94ce00a14f3d825a067a807eb12
Closes-Bug: #1779606
2018-07-02 14:43:49 +09:00
Balazs Gibizer
ff4f58fcd2 Fix the usage of instance.snapshot notification sample
The instance.snapshot.start and .end notification sample file was
attached to two different Notification ovo by mistake. This caused that
the samples are appeared in the notification dev-ref twice.

This patch removes the duplication and adds a simple check to the doc
generation code to detech such problems in the future.

Change-Id: I8478c134f9cdb08c02a44e1838dbacede5523914
Closes-Bug: #1732685
2017-11-21 11:03:52 +00:00
Balazs Gibizer
5a5155ea4e Factor out duplicated notification sample data
Versioned notifications are functionally tested against stored sample
data. Also most of the instance notitication shares payload structure.
Today we store a separate sample for every instance notification.
These samples store similar, mostly redundant data. When a new field
is added to the InstancePayload then every instance notification
related sample file needs to be modified. This leads to big and
redundant changes like I18af99479562e2fe5e74e6e1252b804b074fee58.

To remove the redundancy this patch proposes to use json references
in the sample files instead of copy pasting the same notification
sample fragment to every sample.

As a first step this patch introduces a small json ref resolver.
Then subsequent patches will replace the duplicated sample data
with references to common sample fragments.

This proposed resolver supports resolving the refs recursively so
a referenced json fragment can reference further fragments. However
the current implementation does not handle reference loops.
The resolver also supports overriding parts of the referenced
json fragment to support content customization needed in the next
patch.

Change-Id: Ic3ab7d60e4ac12b767fe70bef97b327545a86e74
2017-11-03 11:36:57 +01:00
Jenkins
c57bfdfed1 Merge "doc: Remove deprecated call to sphinx.util.compat" 2017-09-06 18:14:40 +00:00
Balazs Gibizer
0499b28051 doc: fix show-hide sample in notification devref
The new doc template includes jquery too late and therefore showing
and hindig notification samples and auto hiding them by default doesn't
work.

This patch loads the jquery lib earlier for the notification devref.

Closes-Bug: #1713974
Closes-Bug: #1714363
Change-Id: I07db4755c69d493e591761578d1077bb44acda41
2017-09-01 12:39:01 +02:00
Stephen Finucane
46a5569fb1 doc: Remove deprecated call to sphinx.util.compat
This call generates the following deprecation warning:

  RemovedInSphinx17Warning: sphinx.util.compat.Directive is deprecated
  and will be removed in Sphinx 1.7, please use docutils' instead.

Resolve this.

Change-Id: I73a182248a64d1e931a1bcb3989aa96f0aec71ed
2017-08-29 15:12:10 +01:00
Stephen Finucane
62ccbe1c3f doc: Enable pep8 on doc generation code
As pep8 does not run on doc generation python code so we have some
style violations there. As it not too hard to fix the problems and
therefore enable pep8 on these files this patch proposes such a
change.

Change-Id: I26104ea66fc4f3e67f8227025f43202e483beb25
2017-07-12 14:20:25 +01:00
Balazs Gibizer
5a35a2b99e add missing notification samples to dev ref
The already transformed aggregate notifications were missing from the
notification dev-ref due to a missing import in the doc generation code.

This patch improves the doc generation to automatically pick up new modules
added under nova.notitications.objects.

Change-Id: I688bc59f19814956d73e04b4970add21ce64ba90
Closes-Bug: #1698779
2017-06-19 13:46:47 +02:00
Béla Vancsics
ad56be6d22 Transform keypair.create notification
The keypair.create.start and keypair.create.end notifications
has been transformed to the versioned notification framework.

Change-Id: I71e9d8dae55653ad3ee70f708a6d92c98ed20c1c
Implements: bp versioned-notification-transformation-pike
2017-06-14 07:28:47 +02:00
liyingjun
8d9b3d6b9d Notifications for flavor operations
This patch implements the versioned notifications for flavor
create and destroy.

Implement blueprint: flavor-notifications

Change-Id: Icc2169b87ffba4e7e2079076a82029156c584c6a
2017-01-09 20:39:58 +08:00
Balazs Gibizer
b8897aba72 Fix notification doc generator
The doc generator only picked up the event types related to instance
actions because the doc generator looked up the registered notification
classes only. Until now, only the instance related notifications were
imported in the doc generation environment so the other notification
classes were not registered.

This commit explicitly imports the modules that defines the notification
classes to make the doc complete.

Change-Id: I269e05ddb62ec6c6cc7f7922c1344186ccf850d1
Closes-bug: #1640818
2016-11-24 13:25:54 +00:00
Balazs Gibizer
e5798f9f9d Enhance notification doc generation with samples
Until now the notification devref only contained a link to the sample file
and that link did only exist after the sample file was merged.
This is suboptimal as the locally generated doc might be incomplete.

This patch changes the doc to contain the content of the sample file.

Change-Id: I4343a2feb13de8b614e8d42d5f1db14102ab492e
2016-07-20 17:33:32 +00:00
Balazs Gibizer
8279b1ea2e Handle multiple samples per versioned notification
The notification_sample decorator is changed to handle
attaching multiple sample files to a notification object.

Change-Id: I4c3df17d93282f6946221da65d26d0ca3194d3df
2016-06-21 09:39:54 +02:00
Balazs Gibizer
520ee65a55 Do not register notification objects
Only registering the notification objects during unit test.
Notification objects are never used in the Nova RPC interface
and shall not be mixed with such objects.

Change-Id: Iba9079bb204e6ef1302529ac159199ab9fa6272b
2016-06-08 11:32:53 +02:00
Balazs Gibizer
5e074a59d2 Move notification related code to separate package
To be able to separate the versioned notification related
object model from the nova internal object model a new
nova.notification.object package is introduced.

As nova had nova/notifications.py already in the tree
the code from that file is moved into the new nova.notification
package as a first step.

Implements: bp versioned-notification-transformation-newton
Change-Id: I315f548180c260c22a2ebcf7b7cb56d284b6e580
2016-06-08 11:32:53 +02:00
Balazs Gibizer
05adc8d006 Generate doc for versioned notifications
This commit adds a new sphinx extension that inspects the nova code
and adds information about the existing versioned notifications to
the nofitications devref. This way the devref is automatically kept
up to date with relevant information.

Partially-Implements: bp versioned-notification-api
Change-Id: If65d5d81e26cb2b4a9f57a8c7d37d3de310ebe00
2016-01-28 15:33:06 +01:00