]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: specify license when opting in
authorSage Weil <sage@redhat.com>
Thu, 25 Jul 2019 22:28:34 +0000 (17:28 -0500)
committerJoao Eduardo Luis <joao@suse.com>
Mon, 9 Dec 2019 19:36:54 +0000 (19:36 +0000)
Choosing not to include this in the docs so that the user is more likely
to see this interactively.  (That is...probably good?)

Choose sharing-1-0.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit f1eac8ba4becfb0ad6a7e7a303fc45a9d6ab59ee)

Conflicts:
src/pybind/mgr/telemetry/module.py
          Slight conflicts due to past cherry-picks (or lack thereof)
          Using set_config() instead of set_module_option()

src/pybind/mgr/telemetry/module.py

index 5df9c6dc909790ed485b898d49b40a9783e2acd1..d0bc4fe67428a610a124bef9f286d8ff475fe3d7 100644 (file)
@@ -18,6 +18,11 @@ from mgr_module import MgrModule
 
 ALL_CHANNELS = ['basic', 'ident']
 
+LICENSE='sharing-1-0'
+LICENSE_NAME='Community Data License Agreement - Sharing - Version 1.0'
+LICENSE_URL='https://cdla.io/sharing-1-0/'
+
+
 class Module(MgrModule):
     config = dict()
 
@@ -108,7 +113,7 @@ class Module(MgrModule):
             "perm": "r"
         },
         {
-            "cmd": "telemetry on",
+            "cmd": "telemetry on name=license,type=CephString,req=false",
             "desc": "Enable telemetry reports from this cluster",
             "perm": "rw",
         },
@@ -245,6 +250,7 @@ class Module(MgrModule):
             'report_id': self.report_id,
             'channels': channels,
             'channels_available': ALL_CHANNELS,
+            'license': LICENSE,
         }
 
         if 'ident' in channels:
@@ -340,6 +346,8 @@ class Module(MgrModule):
             self.set_config(key, value)
             return 0, 'Configuration option {0} updated'.format(key), ''
         elif command['prefix'] == 'telemetry on':
+            if command.get('license') != LICENSE:
+                return -errno.EPERM, '', "Telemetry data is licensed under the " + LICENSE_NAME + " (" + LICENSE_URL + ").\nTo enable, add '--license " + LICENSE + "' to the 'ceph telemetry on' command."
             self.set_config('enabled', True)
             return 0, '', ''
         elif command['prefix'] == 'telemetry off':