Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1794)

Issue 7301085: charm: Fix bug #864164 - non-exec hooks (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by dimitern
Modified:
11 years, 2 months ago
Reviewers:
mp+148071, jameinel, fwereade
Visibility:
Public.

Description

charm: Fix bug #864164 - non-exec hooks Changed ExpandTo() to force executable permissions to hooks which are lacking these permissions (setting --x--x--x only). Added a check in BundleTo() to issue warnings if any hooks are found to lack executable permissions, telling the user juju will set --x--x--x for these hooks. Also added tests for both changes. Only files inside hooks/ are checked, if they are named like hooks. https://code.launchpad.net/~dimitern/juju-core/bug-864164-check-charm-hooks-are-executable/+merge/148071 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 20
Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, --2 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M charm/bundle.go View 3 chunks +7 lines, -0 lines 7 comments Download
M charm/bundle_test.go View 2 chunks +51 lines, -0 lines 4 comments Download
M charm/dir.go View 3 chunks +12 lines, -0 lines 7 comments Download
M charm/dir_test.go View 2 chunks +33 lines, -0 lines 2 comments Download
M charm/export_test.go View 2 chunks +3 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/bar-relation-broken View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/bar-relation-changed View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/bar-relation-departed View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/bar-relation-joined View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/config-changed View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/foo-relation-broken View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/foo-relation-changed View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/foo-relation-departed View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/foo-relation-joined View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/install View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/otherdata View 0 chunks +-1 lines, --1 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/self-relation-broken View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/self-relation-changed View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/self-relation-departed View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/self-relation-joined View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/start View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/stop View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/subdir/stuff View 0 chunks +-1 lines, --1 lines 0 comments Download
A testing/repo/series/all-hooks/hooks/upgrade-charm View 1 chunk +2 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/metadata.yaml View 1 chunk +12 lines, -0 lines 0 comments Download
A testing/repo/series/all-hooks/revision View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 6
dimitern
Please take a look.
11 years, 2 months ago (2013-02-13 01:31:54 UTC) #1
jameinel
LGTM https://codereview.appspot.com/7301085/diff/1/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7301085/diff/1/charm/bundle.go#newcode231 charm/bundle.go:231: } Offhand, I wonder if 0110 or even ...
11 years, 2 months ago (2013-02-13 04:06:16 UTC) #2
fwereade
Looking good -- some comments, some of which may be best addressed by adding a ...
11 years, 2 months ago (2013-02-13 10:31:47 UTC) #3
dimitern
Thanks for the reviews, here are my answers. https://codereview.appspot.com/7301085/diff/1/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7301085/diff/1/charm/bundle.go#newcode187 charm/bundle.go:187: var ...
11 years, 2 months ago (2013-02-13 11:28:19 UTC) #4
jameinel
https://codereview.appspot.com/7301085/diff/1/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7301085/diff/1/charm/bundle.go#newcode187 charm/bundle.go:187: var hookNameRegexp = regexp.MustCompile("^(hooks/)?(install|start|config-changed|upgrade-charm|stop)|([^-]+-relation-(joined|changed|departed|broken))$") ... > 2) I don't ...
11 years, 2 months ago (2013-02-13 12:01:33 UTC) #5
dimitern
11 years, 2 months ago (2013-02-14 12:32:02 UTC) #6
As discussed, I'll close this and propose a simpler solution, addressing what
was suggested, having https://codereview.appspot.com/7303091 as a prerequisite.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b