summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Clarke <diana.joan.clarke@gmail.com>2016-12-29 14:33:37 -0600
committerDiana Clarke <diana.joan.clarke@gmail.com>2016-12-30 11:49:03 -0500
commite8e39ed343622350e114c84ecd5fcc0c94bfec6b (patch)
tree44dcf1895155b5ea830eeb76e304c57a48b9c00a
parent084b0abb755ac36415058f485fc6b0f318d9c041 (diff)
downloadpython-novaclient-e8e39ed343622350e114c84ecd5fcc0c94bfec6b.tar.gz
Blacklist rather than whitelist autodoc modules
Autogenerate the nova client python API module list rather than having to remember to add new modules; use exclude to blacklist modules that shouldn't be included in autodoc. Change-Id: I051a7094f3b536f1e9a939af87e3fc89554fb375
-rw-r--r--doc/source/conf.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 935a45f9..237a363a 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -70,18 +70,17 @@ def gen_ref(ver, title, names):
"signs": "=" * len(name),
"pkg": pkg, "name": name})
+
+def get_module_names():
+ names = os.listdir(os.path.join(ROOT, 'novaclient', 'v2'))
+ exclude = ['shell.py', '__init__.py']
+ for name in names:
+ if name.endswith('.py') and name not in exclude:
+ yield name.strip('.py')
+
+
gen_ref(None, "Exceptions", ["exceptions"])
-gen_ref("v2", "Version 1.1, Version 2 API",
- ["agents", "aggregates", "assisted_volume_snapshots",
- "availability_zones", "cells", "certs", "client", "cloudpipe",
- "fixed_ips", "flavor_access", "flavors", "floating_ip_dns",
- "floating_ip_pools", "floating_ips", "floating_ips_bulk", "fping",
- "hosts", "hypervisors", "images", "instance_action", "keypairs",
- "limits", "list_extensions", "migrations", "networks",
- "quota_classes", "quotas", "security_group_default_rules",
- "security_group_rules", "security_groups", "server_external_events",
- "server_groups", "server_migrations", "servers", "services", "usage",
- "versions", "virtual_interfaces", "volumes"])
+gen_ref("v2", "Version 2 API", sorted(get_module_names()))
# -- General configuration ----------------------------------------------------