From: Kefu Chai Date: Sun, 6 Mar 2022 07:20:14 +0000 (+0800) Subject: mgr/cephadm: improve the formatting of docstring X-Git-Tag: v17.2.0~5^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ebbc13ff6db4f6a6a6acae9ff86994bec18fe9f;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 (cherry picked from commit 8685fffdf20eeb4e2068c421e351aa02c48ff860) --- diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 5bf47d39c79f..be3f9deebeee 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: