From 8685fffdf20eeb4e2068c421e351aa02c48ff860 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 6 Mar 2022 15:20:14 +0800 Subject: [PATCH] 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 --- src/python-common/ceph/deployment/service_spec.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index eed173579078f..eac53f511d299 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: