From: Kefu Chai Date: Sun, 6 Mar 2022 07:20:14 +0000 (+0800) Subject: mgr/cephadm: improve the formatting of docstring X-Git-Tag: v18.0.0~1277^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8685fffdf20eeb4e2068c421e351aa02c48ff860;p=ceph.git mgr/cephadm: improve the formatting of docstring add an empty line before a doctest block would help sphinx to tell where the session starts. see also https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#doctest-blocks Signed-off-by: Kefu Chai --- diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index eed173579078..eac53f511d29 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -314,28 +314,34 @@ class PlacementSpec(object): # type: (Optional[str]) -> PlacementSpec """ A single integer is parsed as a count: + >>> PlacementSpec.from_string('3') PlacementSpec(count=3) A list of names is parsed as host specifications: + >>> PlacementSpec.from_string('host1 host2') PlacementSpec(hosts=[HostPlacementSpec(hostname='host1', network='', name=''), HostPlacemen\ tSpec(hostname='host2', network='', name='')]) You can also prefix the hosts with a count as follows: + >>> PlacementSpec.from_string('2 host1 host2') PlacementSpec(count=2, hosts=[HostPlacementSpec(hostname='host1', network='', name=''), Hos\ tPlacementSpec(hostname='host2', network='', name='')]) - You can spefify labels using `label: