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: Ie7b99dfa4cbe00a03acf1b2cc2eeecc7f84fbe17
Closes-bug: #1815243
Partial-bug: #1815231
changes/40/635940/1
Ryan Beisner 4 months ago
parent
commit
c4e5565799
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
 # Wrapper to deal with newer Ubuntu versions that don't have py2 installed
3 3
 # by default.
4 4
 

+ 1
- 1
hooks/install_deps View File

@@ -1,4 +1,4 @@
1
-#!/bin/bash
1
+#!/bin/bash -e
2 2
 # Install required dependencies for charm runtime
3 3
 
4 4
 declare -a DEPS=('apt' 'netaddr' 'netifaces' 'yaml' 'jinja2' 'dnspython')

+ 1
- 1
hooks/upgrade-charm View File

@@ -1,4 +1,4 @@
1
-#!/bin/bash
1
+#!/bin/bash -e
2 2
 # Re-install dependencies to deal with py2->py3 switch for charm
3 3
 
4 4
 ./hooks/install_deps

Loading…
Cancel
Save