Browse Source

Update pre-install hooks to fail on error

The pre-install operations may fail, yet that failure is not
elevated to the user. This masks the failure and makes early
package install issues difficult to troubleshoot.

If the basic pre-install script fails, the charm should not
proceed to later hooks as the requirements may not be met.

Hashbangs for bash should specify -e (errexit) on all of the
pre-install bash scripts.

Change-Id: I6e015c2e0a28f9b990bfd7b84a2317d339abbb4e
Closes-bug: #1815243
Partial-bug: #1815231
changes/37/635937/1
Ryan Beisner 4 months ago
parent
commit
be74c0fd1c
No account linked to committer's email address
3 changed files with 3 additions and 3 deletions
  1. 1
    1
      hooks/install
  2. 1
    1
      hooks/install_deps
  3. 1
    1
      hooks/upgrade-charm

+ 1
- 1
hooks/install View File

@@ -1,4 +1,4 @@
1
-#!/bin/bash
1
+#!/bin/bash -e
2 2
 # ensure that the python3 bits are installed, whichever version of ubunut
3 3
 # is being installed.
4 4
 

+ 1
- 1
hooks/install_deps View File

@@ -1,4 +1,4 @@
1
-#!/bin/bash
1
+#!/bin/bash -e
2 2
 # Wrapper to ensure that python dependencies are installed before we get into
3 3
 # the python part of the hook execution
4 4
 

+ 1
- 1
hooks/upgrade-charm View File

@@ -1,4 +1,4 @@
1
-#!/bin/bash
1
+#!/bin/bash -e
2 2
 # Wrapper to ensure that old python bytecode isn't hanging around
3 3
 # after we upgrade the charm with newer libraries
4 4
 rm -rf **/*.pyc

Loading…
Cancel
Save