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

Issue 7305096: 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+148698
Visibility:
Public.

Description

charm: Fix bug #864164 - non-exec hooks Changed ExpandTo() and BundleTo() to set executable permissions while processing charm hook files. In the case of BundleTo(), as mentioned in the bug, a warning is issued to the log about this, while in ExpandTo() it happens silently. Permissions of hooks are set executable by owner. Added tests and a testing charm with all hooks defined. https://code.launchpad.net/~dimitern/juju-core/bug-864164-executable-hooks/+merge/148698 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10

Patch Set 2 : charm: Fix bug #864164 - non-exec hooks #

Total comments: 32

Patch Set 3 : charm: Fix bug #864164 - non-exec hooks #

Patch Set 4 : charm: Fix bug #864164 - non-exec hooks #

Total comments: 7

Patch Set 5 : charm: Fix bug #864164 - non-exec hooks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -5 lines) Patch
M .bzrignore View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M charm/bundle.go View 1 2 3 4 3 chunks +13 lines, -2 lines 0 comments Download
M charm/bundle_test.go View 1 2 2 chunks +66 lines, -0 lines 0 comments Download
M charm/dir.go View 1 2 3 4 3 chunks +11 lines, -2 lines 0 comments Download
M charm/dir_test.go View 1 2 3 2 chunks +53 lines, -0 lines 0 comments Download
M charm/meta.go View 1 2 3 1 chunk +1 line, -1 line 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 1 chunk +1 line, -0 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 1 chunk +1 line, -0 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: 9
dimitern
Please take a look.
11 years, 2 months ago (2013-02-15 12:38:36 UTC) #1
fwereade
On top of what I mention below, I'd really like some tests that we (1) ...
11 years, 2 months ago (2013-02-15 12:57:20 UTC) #2
dimitern
Please take a look. https://codereview.appspot.com/7305096/diff/1/charm/bundle_test.go File charm/bundle_test.go (right): https://codereview.appspot.com/7305096/diff/1/charm/bundle_test.go#newcode89 charm/bundle_test.go:89: c.Assert(dir.Path, Equals, path) On 2013/02/15 ...
11 years, 2 months ago (2013-02-15 13:35:08 UTC) #3
fwereade
looking nice and clean,but a couple more comments... https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go#newcode227 charm/bundle.go:227: hookName ...
11 years, 2 months ago (2013-02-15 14:30:50 UTC) #4
rog
looks good. a few comments below. https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go#newcode187 charm/bundle.go:187: func (b *Bundle) ...
11 years, 2 months ago (2013-02-15 15:26:42 UTC) #5
dimitern
Please take a look. https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go#newcode227 charm/bundle.go:227: hookName := filepath.Base(cleanName) On 2013/02/15 ...
11 years, 2 months ago (2013-02-15 15:28:21 UTC) #6
dimitern
Please take a look. https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7305096/diff/8001/charm/bundle.go#newcode187 charm/bundle.go:187: func (b *Bundle) expand(hooks map[string]bool, ...
11 years, 2 months ago (2013-02-15 16:13:42 UTC) #7
fwereade
LGTM https://codereview.appspot.com/7305096/diff/17001/charm/bundle.go File charm/bundle.go (right): https://codereview.appspot.com/7305096/diff/17001/charm/bundle.go#newcode230 charm/bundle.go:230: // Process only hooks directly inside hooks/ Nice ...
11 years, 2 months ago (2013-02-15 16:34:33 UTC) #8
dimitern
11 years, 2 months ago (2013-02-15 17:56:15 UTC) #9
*** Submitted:

charm: Fix bug #864164 - non-exec hooks

Changed ExpandTo() and BundleTo() to set
executable permissions while processing
charm hook files. In the case of BundleTo(),
as mentioned in the bug, a warning is issued
to the log about this, while in ExpandTo()
it happens silently.
Permissions of hooks are set executable by owner.
Added tests and a testing charm with all hooks
defined.

R=fwereade, rog
CC=
https://codereview.appspot.com/7305096

https://codereview.appspot.com/7305096/diff/17001/charm/bundle.go
File charm/bundle.go (right):

https://codereview.appspot.com/7305096/diff/17001/charm/bundle.go#newcode230
charm/bundle.go:230: // Process only hooks directly inside hooks/
On 2013/02/15 16:34:33, fwereade wrote:
> Nice -- but not sure you even need this comment :)

Done.

https://codereview.appspot.com/7305096/diff/17001/charm/bundle_test.go
File charm/bundle_test.go (right):

https://codereview.appspot.com/7305096/diff/17001/charm/bundle_test.go#newcode68
charm/bundle_test.go:68: func (s *BundleSuite) prepareBundle(c *C, charmDir
*charm.Dir, bundlePath string) {
On 2013/02/15 16:34:33, fwereade wrote:
> Could have sworn there was already something like this, but if not sgtm
I couldn't quite find anything close enough to how bundles are created, to reuse
it.

https://codereview.appspot.com/7305096/diff/17001/charm/dir.go
File charm/dir.go (right):

https://codereview.appspot.com/7305096/diff/17001/charm/dir.go#newcode186
charm/dir.go:186: // Process only hooks directly inside hooks/
On 2013/02/15 16:34:33, fwereade wrote:
> Similarly

Done.
Sign in to reply to this message.

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