Merge lp:~sylvain-pineau/checkbox/app_blob_removal into lp:checkbox

Proposed by Sylvain Pineau
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 3593
Merged at revision: 3599
Proposed branch: lp:~sylvain-pineau/checkbox/app_blob_removal
Merge into: lp:checkbox
Diff against target: 42 lines (+1/-17)
1 file modified
checkbox-ng/checkbox_ng/commands/newcli.py (+1/-17)
To merge this branch: bzr merge lp:~sylvain-pineau/checkbox/app_blob_removal
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+251594@code.launchpad.net

Description of the change

This MR removes the app_blob creation in checkbox-ng newcli as:

1. it's not used even after resume
2. prevent qualifiers without source filenames to be recorded

I didn't find a reason why we put such code, newcli first version already proposed this mechanism (without details).

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1, thanks.

I checked how we use self._whitelists and it seems that we don't use that at all after resuming a session. Weird.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-ng/checkbox_ng/commands/newcli.py'
2--- checkbox-ng/checkbox_ng/commands/newcli.py 2015-02-19 11:18:40 +0000
3+++ checkbox-ng/checkbox_ng/commands/newcli.py 2015-03-03 13:28:42 +0000
4@@ -30,7 +30,6 @@
5 from logging import getLogger
6 from shutil import copyfileobj
7 import io
8-import json
9 import operator
10 import os
11 import re
12@@ -154,8 +153,6 @@
13 self.select_local_jobs()
14 self.run_all_selected_jobs()
15 self.interactively_pick_jobs_to_run()
16- else:
17- self.load_app_blob()
18 # Maybe ask the secure launcher to prompt for the password now. This is
19 # imperfect as we are going to run local jobs and we cannot see if they
20 # might need root or not. This cannot be fixed before template jobs are
21@@ -173,20 +170,7 @@
22
23 def store_application_metadata(self):
24 super().store_application_metadata()
25- self.metadata.app_blob = json.dumps([
26- whitelist.origin.source.filename
27- for whitelist in self._whitelists
28- ]).encode("UTF-8")
29- logger.info("Saved whitelist mask: %r", self._whitelists)
30-
31- def load_app_blob(self):
32- whitelist_filename_list = json.loads(
33- self.metadata.app_blob.decode("UTF-8"))
34- whitelist_list = [
35- WhiteList.from_file(filename)
36- for filename in whitelist_filename_list]
37- self._whitelists = whitelist_list
38- logger.info("Loaded whitelist mask: %r", self._whitelists)
39+ self.metadata.app_blob = b''
40
41 def show_welcome_screen(self):
42 text = self.launcher.text

Subscribers

People subscribed via source and target branches