]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
python-common: service_spec.from_json: Add docstring explaining histroy
authorSebastian Wagner <sebastian.wagner@suse.com>
Thu, 25 Jun 2020 10:31:36 +0000 (12:31 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 25 Jun 2020 10:33:19 +0000 (12:33 +0200)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/python-common/ceph/deployment/service_spec.py

index d53a2832e364f99550fae998ac01bf05a226f91d..a041f4c53a74ecb347a967affd158d1a33cb3e9c 100644 (file)
@@ -426,6 +426,35 @@ class ServiceSpec(object):
         # then, the real type is: (dict) -> ServiceSpecs
         """
         Initialize 'ServiceSpec' object data from a json structure
+
+        There are two valid styles for service specs:
+
+        the "old" style:
+
+        .. code:: yaml
+
+            service_type: nfs
+            service_id: foo
+            pool: mypool
+            namespace: myns
+
+        and the "new" style:
+
+        .. code:: yaml
+
+            service_type: nfs
+            service_id: foo
+            spec:
+              pool: mypool
+              namespace: myns
+
+        In https://tracker.ceph.com/issues/45321 we decided that we'd like to
+        prefer the new style as it is more readable and provides a better
+        understanding of what fields are special for a give service type.
+
+        Note, we'll need to stay compatible with both versions for the
+        the next two major releases (octoups, pacific).
+
         :param json_spec: A valid dict with ServiceSpec
         """