From: Yaarit Hatuka Date: Wed, 12 Jan 2022 05:01:48 +0000 (+0000) Subject: mgr/telemetry: verify there are new collections when nagging due to a major X-Git-Tag: v17.1.0~50^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=813ab8a7c6895b9364da19d50e0eb8856b0ab3cf;p=ceph.git mgr/telemetry: verify there are new collections when nagging due to a major 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 --- diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 4d75bb914da..c30a488fee4 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -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.