From: Kefu Chai Date: Sun, 6 Mar 2022 07:20:14 +0000 (+0800) Subject: mgr/cephadm: improve the formatting of docstring X-Git-Tag: v16.2.8~24^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b584e752d62e6867f7518d34e12ff7f5f728f369;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 aca41edea5c2b..bb57ea742a181 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: