Merge lp:~tvansteenburgh/charm-tools/lp-1357507 into lp:charm-tools/1.3

Proposed by Tim Van Steenburgh
Status: Needs review
Proposed branch: lp:~tvansteenburgh/charm-tools/lp-1357507
Merge into: lp:charm-tools/1.3
Diff against target: 61 lines (+12/-4)
3 files modified
charmtools/charms.py (+5/-4)
tests_functional/create/test_python_create.py (+6/-0)
tests_functional/proof/expected/test (+1/-0)
To merge this branch: bzr merge lp:~tvansteenburgh/charm-tools/lp-1357507
Reviewer Review Type Date Requested Status
Charm Toolers Pending
Review via email: mp+232597@code.launchpad.net

Description of the change

Make non-executable hook file a proof ERROR instead of INFO.

To post a comment you must log in.

Unmerged revisions

338. By Tim Van Steenburgh

Make non-executable hook a proof error

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmtools/charms.py'
--- charmtools/charms.py 2014-06-17 15:44:04 +0000
+++ charmtools/charms.py 2014-08-28 16:53:40 +0000
@@ -58,7 +58,7 @@
58 try:58 try:
59 mode = os.stat(hook_path)[ST_MODE]59 mode = os.stat(hook_path)[ST_MODE]
60 if not mode & S_IXUSR:60 if not mode & S_IXUSR:
61 self.info(hook + " not executable")61 self.err(hook + " not executable")
62 with open(hook_path, 'r') as hook_file:62 with open(hook_path, 'r') as hook_file:
63 count = 063 count = 0
64 for line in hook_file:64 for line in hook_file:
@@ -247,9 +247,10 @@
247247
248 charm_basename = os.path.basename(charm_path)248 charm_basename = os.path.basename(charm_path)
249 if charm['name'] != charm_basename:249 if charm['name'] != charm_basename:
250 warn_msg = ("metadata name (%s) must match directory name (%s)"250 warn_msg = (
251 " exactly for local deployment.") % (251 "metadata name (%s) must match directory name (%s)"
252 charm['name'], charm_basename)252 " exactly for local deployment.") % (
253 charm['name'], charm_basename)
253 lint.warn(warn_msg)254 lint.warn(warn_msg)
254255
255 # summary should be short256 # summary should be short
256257
=== modified file 'tests_functional/charms/test/hooks/install' (properties changed: +x to -x)
=== modified file 'tests_functional/create/test_python_create.py'
--- tests_functional/create/test_python_create.py 2014-06-20 19:46:59 +0000
+++ tests_functional/create/test_python_create.py 2014-08-28 16:53:40 +0000
@@ -39,6 +39,8 @@
3939
4040
41class PythonCreateTest(TestCase):41class PythonCreateTest(TestCase):
42 maxDiff = None
43
42 def setUp(self):44 def setUp(self):
43 self.tempdir = tempfile.mkdtemp()45 self.tempdir = tempfile.mkdtemp()
4446
@@ -58,6 +60,10 @@
58 'lib/charmhelpers/core/fstab.py',60 'lib/charmhelpers/core/fstab.py',
59 'lib/charmhelpers/core/hookenv.py',61 'lib/charmhelpers/core/hookenv.py',
60 'lib/charmhelpers/core/host.py',62 'lib/charmhelpers/core/host.py',
63 'lib/charmhelpers/core/services/__init__.py',
64 'lib/charmhelpers/core/services/base.py',
65 'lib/charmhelpers/core/services/helpers.py',
66 'lib/charmhelpers/core/templating.py',
61 ]67 ]
62 return sorted(static_files + dynamic_files)68 return sorted(static_files + dynamic_files)
6369
6470
=== modified file 'tests_functional/proof/expected/test'
--- tests_functional/proof/expected/test 2014-05-16 06:06:43 +0000
+++ tests_functional/proof/expected/test 2014-08-28 16:53:40 +0000
@@ -9,4 +9,5 @@
9E: template relations should be renamed to fit charm: relation-name9E: template relations should be renamed to fit charm: relation-name
10E: template interface names should be changed: interface-name10E: template interface names should be changed: interface-name
11E: template relations should be renamed to fit charm: relation-name11E: template relations should be renamed to fit charm: relation-name
12E: install not executable
12I: missing recommended hook config-changed13I: missing recommended hook config-changed

Subscribers

People subscribed via source and target branches