Merge ~didrocks/ubiquity:master-fix-oem into ubiquity:master

Proposed by Didier Roche-Tolomelli
Status: Merged
Approved by: Jean-Baptiste Lallement
Approved revision: a9e7835e754f1f2e1d5d342baec244c6f8434bd9
Merged at revision: 70753bae0b6c2565ab1875f64006ff4b27d56d22
Proposed branch: ~didrocks/ubiquity:master-fix-oem
Merge into: ubiquity:master
Diff against target: 75 lines (+13/-0)
5 files modified
ubiquity/frontend/debconf_ui.py (+1/-0)
ubiquity/frontend/gtk_ui.py (+1/-0)
ubiquity/frontend/kde_ui.py (+1/-0)
ubiquity/frontend/noninteractive.py (+1/-0)
ubiquity/telemetry.py (+9/-0)
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+347043@code.launchpad.net

Commit message

Only record OEM config when installing

Don't record telemetry data when doing stage 2 (user mode) as
it keeps an unused /target directory. (LP: #1773321)
Also, record OEM types. (LP: #1765693)

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

This was tested with GTK, KDE and debconf UI. Both with OEM and non OEM mode, including stage 2 (oem user mode).

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

LGTM. Tested successfully on cosmic. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubiquity/frontend/debconf_ui.py b/ubiquity/frontend/debconf_ui.py
2index 7ec4d7f..1690ba5 100644
3--- a/ubiquity/frontend/debconf_ui.py
4+++ b/ubiquity/frontend/debconf_ui.py
5@@ -95,6 +95,7 @@ class Wizard(BaseFrontend):
6 sys.exit(1)
7
8 telemetry.get().set_installer_type('DebConf')
9+ telemetry.get().set_is_oem(self.oem_config)
10 telemetry.get().add_stage(telemetry.START_INSTALL_STAGE_TAG)
11
12 self.pagesindex = 0
13diff --git a/ubiquity/frontend/gtk_ui.py b/ubiquity/frontend/gtk_ui.py
14index f94cd3b..88608ea 100644
15--- a/ubiquity/frontend/gtk_ui.py
16+++ b/ubiquity/frontend/gtk_ui.py
17@@ -757,6 +757,7 @@ class Wizard(BaseFrontend):
18 self.refresh()
19
20 telemetry.get().set_installer_type('GTK')
21+ telemetry.get().set_is_oem(self.oem_config)
22
23 self.set_current_page(0)
24 self.live_installer.show()
25diff --git a/ubiquity/frontend/kde_ui.py b/ubiquity/frontend/kde_ui.py
26index a73c531..2b2c6fc 100644
27--- a/ubiquity/frontend/kde_ui.py
28+++ b/ubiquity/frontend/kde_ui.py
29@@ -455,6 +455,7 @@ class Wizard(BaseFrontend):
30 self.refresh()
31
32 telemetry.get().set_installer_type('KDE')
33+ telemetry.get().set_is_oem(self.oem_config)
34
35 # Start the interface
36 self.set_current_page(0)
37diff --git a/ubiquity/frontend/noninteractive.py b/ubiquity/frontend/noninteractive.py
38index c53a400..daee07a 100644
39--- a/ubiquity/frontend/noninteractive.py
40+++ b/ubiquity/frontend/noninteractive.py
41@@ -78,6 +78,7 @@ class Wizard(BaseFrontend):
42 sys.exit(1)
43
44 telemetry.get().set_installer_type('NonInteractive')
45+ telemetry.get().set_is_oem(self.oem_config)
46 telemetry.get().add_stage(telemetry.START_INSTALL_STAGE_TAG)
47
48 for x in self.pages:
49diff --git a/ubiquity/telemetry.py b/ubiquity/telemetry.py
50index 7f68eac..da5c6c3 100644
51--- a/ubiquity/telemetry.py
52+++ b/ubiquity/telemetry.py
53@@ -62,6 +62,10 @@ class _Telemetry():
54 """Record installer type"""
55 self._metrics['Type'] = installer_type
56
57+ def set_is_oem(self, is_oem):
58+ """Record if OEM installation"""
59+ self._metrics['OEM'] = is_oem
60+
61 def set_partition_method(self, method):
62 """Record anynomized partition method"""
63 self._metrics['PartitionMethod'] = method
64@@ -88,6 +92,11 @@ class _Telemetry():
65 db.get('ubiquity/use_nonfree'))
66 self._metrics['Stages'] = self._stages_hist
67
68+ # don't save oem user config for now. We may merge the 2 installation
69+ # records in the future.
70+ if 'UBIQUITY_OEM_USER_CONFIG' in os.environ:
71+ return
72+
73 target_dir = os.path.dirname(self._dest_path)
74 try:
75 if not os.path.exists(target_dir):

Subscribers

People subscribed via source and target branches