Merge lp:~daniel-thewatkins/charms/trusty/ubuntu-repository-cache/handle_mounted_ephemeral_disk into lp:charms/trusty/ubuntu-repository-cache

Proposed by Dan Watkins on 2015-06-08
Status: Rejected
Rejected by: Marco Ceppi on 2015-07-09
Proposed branch: lp:~daniel-thewatkins/charms/trusty/ubuntu-repository-cache/handle_mounted_ephemeral_disk
Merge into: lp:charms/trusty/ubuntu-repository-cache
Diff against target: 58 lines (+16/-5)
3 files modified
lib/charmhelpers/contrib/storage/linux/utils.py (+1/-1)
lib/ubuntu_repository_cache/storage.py (+3/-4)
patches/storage-0001-full-disk-is_device_mounted.patch (+12/-0)
To merge this branch: bzr merge lp:~daniel-thewatkins/charms/trusty/ubuntu-repository-cache/handle_mounted_ephemeral_disk
Reviewer Review Type Date Requested Status
Marco Ceppi Disapprove on 2015-07-09
Adam Israel 2015-06-08 Approve on 2015-06-25
Review via email: mp+261356@code.launchpad.net

Description of the Change

This cleans up the epheremal disk code path, as well as adding a fix to charmhelpers so we can handle full disk partitions.

To post a comment you must log in.
196. By Dan Watkins on 2015-06-09

Fix finding of partitions on a disk.

197. By Dan Watkins on 2015-06-09

Remove redundant directory creation (which now breaks permissions).

198. By Dan Watkins on 2015-06-09

Fix typo in log message.

199. By Dan Watkins on 2015-06-09

Add is_device_mounted fix.

Adam Israel (aisrael) wrote :

Hi Dan,

I was able to review this yesterday. Per our conversation in #juju, this MP is to fix the issue reported on lp:262072. It might be easier if you merged these changes with that branch, but this update is otherwise good and fixes the charm.

review: Approve
Marco Ceppi (marcoceppi) wrote :

Hi Dan, it seems you're trying patch issues in charmhelpers directly in your charm. You'll instead want/need to make these changes directly to the lp:charm-helpers library and then sync charm-helpers into the charm. This way not only will your charm benefit from these fixes, so will everyone else using charm-helpers. It'll also prevent them from being wiped out on the next sync with this charm.

On that basis alone I'm rejecting this merge, if that's not the case and these changes have found their way into charm-helpers let me know and move the status back to "Needs Review"

Thanks!

review: Disapprove

Unmerged revisions

199. By Dan Watkins on 2015-06-09

Add is_device_mounted fix.

198. By Dan Watkins on 2015-06-09

Fix typo in log message.

197. By Dan Watkins on 2015-06-09

Remove redundant directory creation (which now breaks permissions).

196. By Dan Watkins on 2015-06-09

Fix finding of partitions on a disk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/charmhelpers/contrib/storage/linux/utils.py'
2--- lib/charmhelpers/contrib/storage/linux/utils.py 2015-06-03 10:05:41 +0000
3+++ lib/charmhelpers/contrib/storage/linux/utils.py 2015-06-09 07:43:30 +0000
4@@ -67,4 +67,4 @@
5 out = check_output(['mount']).decode('UTF-8')
6 if is_partition:
7 return bool(re.search(device + r"\b", out))
8- return bool(re.search(device + r"[0-9]+\b", out))
9+ return bool(re.search(device + r"[0-9]*\b", out))
10
11=== modified file 'lib/ubuntu_repository_cache/storage.py'
12--- lib/ubuntu_repository_cache/storage.py 2015-03-27 20:04:13 +0000
13+++ lib/ubuntu_repository_cache/storage.py 2015-06-09 07:43:30 +0000
14@@ -79,8 +79,6 @@
15 # Add the primary mount last for squid. This allocates it last
16 # and saves additional space for metadata mirrors
17 squid_cache = '/'.join((primary_mount, 'squid'))
18- _mkdir(os.path.dirname(squid_cache), owner='proxy', group='proxy',
19- perms=0o770)
20 _mkdir(squid_cache, owner='proxy', group='proxy', perms=0o770)
21 max_size = _disk_free(squid_cache)
22 # Reserve 8GB for metadata and 4GB for the OS
23@@ -129,7 +127,8 @@
24 LOG('%s is not a block device, skipping' % dev, hookenv.ERROR)
25 continue
26
27- partitions = glob.glob(dev + '*').remove(dev) or []
28+ partitions = glob.glob(dev + '*') or []
29+ partitions.remove(dev)
30 for part in partitions:
31 if Storage.is_device_mounted(part):
32 LOG('Ephemeral device had a mounted partition %s skipping' %
33@@ -196,7 +195,7 @@
34
35 config = hookenv.config()
36 try:
37- LOG('Adding check for ephemeral stoage {}'.format(
38+ LOG('Adding check for ephemeral storage {}'.format(
39 config['ephemeral-mounts']),
40 hookenv.DEBUG)
41 except KeyError:
42
43=== added file 'patches/storage-0001-full-disk-is_device_mounted.patch'
44--- patches/storage-0001-full-disk-is_device_mounted.patch 1970-01-01 00:00:00 +0000
45+++ patches/storage-0001-full-disk-is_device_mounted.patch 2015-06-09 07:43:30 +0000
46@@ -0,0 +1,12 @@
47+Submitted as https://code.launchpad.net/~daniel-thewatkins/charm-helpers/lp1370053/+merge/260864.
48+
49+diff --git a/lib/charmhelpers/contrib/storage/linux/utils.py b/lib/charmhelpers/contrib/storage/linux/utils.py
50+index c8373b7..e2769e4 100644
51+--- a/lib/charmhelpers/contrib/storage/linux/utils.py
52++++ b/lib/charmhelpers/contrib/storage/linux/utils.py
53+@@ -67,4 +67,4 @@ def is_device_mounted(device):
54+ out = check_output(['mount']).decode('UTF-8')
55+ if is_partition:
56+ return bool(re.search(device + r"\b", out))
57+- return bool(re.search(device + r"[0-9]+\b", out))
58++ return bool(re.search(device + r"[0-9]*\b", out))

Subscribers

People subscribed via source and target branches

to all changes: