]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: verify there are new collections when nagging due to a major
authorYaarit Hatuka <yaarit@redhat.com>
Wed, 12 Jan 2022 05:01:48 +0000 (05:01 +0000)
committerYaarit Hatuka <yaarit@redhat.com>
Thu, 13 Jan 2022 21:54:07 +0000 (21:54 +0000)
upgrade

When adding a new collection we define whether to nag the user about it.
We may add many collections and nag about none of them. However, in case
of a major upgrade, we wish to notify the user about these new
collections. This commit verifies there are indeed new collections when
nagging due to a major upgrade.

Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
src/pybind/mgr/telemetry/module.py

index 4d75bb914da1a153e09e89b045138b320af87355..c30a488fee4dc8ba46d9b00fbe2bee7bb9268620 100644 (file)
@@ -1180,8 +1180,15 @@ class Module(MgrModule):
                         return True
 
         # user might be opted-in to the most recent collection, or there is no
-        # new collection which requires nagging about
-        return self.is_major_upgrade()
+        # new collection which requires nagging about; thus nag in case it's a
+        # major upgrade and there are new collections
+        # (which their own nag == False):
+        new_collections = False
+        col_delta = self.collection_delta()
+        if col_delta is not None and len(col_delta) > 0:
+            new_collections = True
+
+        return self.is_major_upgrade() and new_collections
 
     def init_collection(self) -> None:
         # We fetch from db the collections the user had already opted-in to.