Merge lp:~jamesodhunt/snappy/add-lsblk-cache into lp:~snappy-dev/snappy/snappy-moved-to-github
Status: | Rejected |
---|---|
Rejected by: | James Hunt |
Proposed branch: | lp:~jamesodhunt/snappy/add-lsblk-cache |
Merge into: | lp:~snappy-dev/snappy/snappy-moved-to-github |
Diff against target: |
465 lines (+220/-115) 8 files modified
cmd/snappy/cmd_booted.go (+2/-2) cmd/snappy/cmd_cache_lsblk.go (+24/-0) partition/bootloader_uboot.go (+0/-106) partition/partition.go (+60/-6) partition/partition_test.go (+2/-0) partition/utils.go (+122/-0) snappy/systemimage.go (+5/-1) snappy/systemimage_test.go (+5/-0) |
To merge this branch: | bzr merge lp:~jamesodhunt/snappy/add-lsblk-cache |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Hunt (community) | Disapprove | ||
Review via email: mp+248245@code.launchpad.net |
Description of the change
* Allow 'snappy list -a' to be run as a non-root user by reading from the lsblk cache.
Note that this branch doesn't add a systemd service to generate the cache since we cannot create a working packaging branch until we've packaged up all the godeps into the archive.
Meantime, to test this:
# Should fail with an error telling you to re-run as root.
$ ./snappy list -a
# Should work
$ sudo ./snappy list -a
# Generate cache to allow non-priv user to run 'snappy list -a'
$ sudo ./snappy cache-lsblk
# Should now work
$ ./snappy list -a
Unmerged revisions
- 136. By James Hunt
-
* Update tests to take account of new lsblk cache code.
- 135. By James Hunt
-
* Allow 'snappy list -a' to be run as a non-root user by reading from
the lsblk cache.
* Show "booted" command as an internal one in usage.
* Add "cache-lsblk" command to generate the cache.
* Move more functions into utils.go.
Thanks for this branch!
I think this looks good but there are some details in the inline comments. I also feel that the new functions in utils.go needs tests. It does not have to be done in this MP but I think we should add them soon.
Another note as suggested by Loic it might be worthwhile to investigate if we can get the information we need (NAME, LABEL, PKNAME, MOUNTPOINT) without the need to run as root as this would avoid having to have the extra systemd unit and the extra command in snappy. This can be done in a followup MP of course.