Commit Graph

22 Commits

Author SHA1 Message Date
Laura Flores
b544e6986c doc/dev: add section on using the gen_state_diagram.py script
Commands sourced from Jianshen Liu's blog post on the Ceph peering state machine: https://jianshenliu.com/blog/development/ceph-peering-state-machine/

Also fixed the formatting of "PG info".

Signed-off-by: Laura Flores <lflores@redhat.com>
2022-02-10 09:12:05 -06:00
Kefu Chai
202b805aaf doc: build mon_command_api.rst using a homebrew extension
so we can build the command doc using ReadTheDoc infra, without adding
the generated rst file to the source repo.

before this change, all the commands are ordered alphabetically. after
this change, command docs are generated by two directives, and are
ordered separately. we could restructure the directives and merge them.

but let's leave it for a future change if this is important.

for more details on writing sphinx directives, see
https://www.sphinx-doc.org/en/master/extdev/markupapi.html and
https://docutils.sourceforge.io/docs/howto/rst-directives.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-08 11:35:42 +08:00
Kefu Chai
4d4983dc0a doc/script/gen_state_diagram: wrap lines which is over 80 chars
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 21:05:14 +08:00
Kefu Chai
ac1f3fa4b3 doc/script/gen_state_diagram: use itertools.cycle() for cycling in colors
for better readability

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 21:05:14 +08:00
Kefu Chai
a14b2b42be doc/script/gen_state_diagram: add "output" parameter to emit_dot()
this allows us to reuse this python script as a module.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 17:00:29 +08:00
Kefu Chai
e9af59a50e doc/script/gen_state_diagram: only run if called as a script
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 17:00:29 +08:00
Jianshen Liu
909bfa34e6 doc: increase visibility of the peering state diagram
Signed-off-by: Jianshen Liu <jliu120@ucsc.edu>
2020-11-18 21:26:54 -07:00
Kefu Chai
fa7ea35832 script/gen_state_diagram.py: s/python/python3/
python does not necessarily on a modern distro which has only python3,
so use python3 instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-08-28 20:35:21 +08:00
Varsha Rao
61e7bcded8 doc/scripts/gen_state_diagram.py: Fix literal comparison syntax warnings
In python3.8 comparing strings using 'is' and 'is not' throws syntax warning.
Instead use equality operator.

Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-11 12:32:57 +05:30
Sebastian Wagner
47330807dc doc/api: Add a generated reference of all mon commands.
Generate a ReST document which contains all mon commands.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-05-05 12:51:50 +02:00
Alfredo Deza
9e2a52ccec doc parse two lines for getting the context
So that signatures can get parsed when they are split like:

PG::RecoveryState::RepWaitBackfillReserved::react(
  const RemoteReservationCanceled &evt)

Signed-off-by: Alfredo Deza <adeza@redhat.com>
2017-10-06 09:10:26 -04:00
Alfredo Deza
347b7b1f19 doc raise exceptions with a base class
Although valid in very old Python, it is no longer possible to raise
"bare" exceptions without a class.

Signed-off-by: Alfredo Deza <adeza@redhat.com>
2017-10-06 08:03:36 -04:00
Kefu Chai
965f20d8ee doc/scripts/gen_state_diagram.py: port to py3
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-11 20:51:11 +08:00
Alfredo Deza
41995c260d doc: style fixes for gen_state_diagram 2016-05-31 14:12:13 -04:00
Li Peng
969c6d464c cleanup: python: remove warnings of 'trailing whitespace'
When applying ceph patches, some warnings reported, e.g.
doc/scripts/gen_state_diagram.py:99: trailing whitespace.

Signed-off-by: Li Peng <lip@dtdream.com>
2016-05-09 11:25:08 +08:00
Sharif Olorin
861e62aa5d Update Python hashbang to respect environment
The /usr/bin/python hashbang causes doc builds to fail when Python3 is
the default Python and Python2 is being used from within a virtualenv or
Pythonbrew environment.

Signed-off-by: Sharif Olorin <sio@tesser.org>
2014-03-11 20:46:53 +11:00
Danny Al-Gaaf
d90b0caf47 gen_state_diagram.py: fix function name
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-25 16:02:47 +02:00
Danny Al-Gaaf
1ee8f39038 gen_state_diagram.py: fix naming of global variables/constants
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-25 16:02:43 +02:00
Danny Al-Gaaf
d9f8de1e89 gen_state_diagram.py: add some missing spaces around operators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-25 16:02:36 +02:00
Danny Al-Gaaf
7cd9d23ff6 gen_state_diagram.py: remove unnecessary semicolon
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-25 16:02:33 +02:00
Samuel Just
7f2354c76d doc/scripts/gen_state_diagram.py: make parser a bit more forgiving
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
1c696b6566 doc: Add peering state diagram
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-11-29 16:35:59 -08:00