Merge ~afreiberger/charm-mongodb:add-py3pip-to-install-hook into charm-mongodb:master

Proposed by Drew Freiberger
Status: Superseded
Proposed branch: ~afreiberger/charm-mongodb:add-py3pip-to-install-hook
Merge into: charm-mongodb:master
Prerequisite: ~zzehring/charm-mongodb:bugfix/lp1882641-trusty-charm-upgrade-fails-import-pip
Diff against target: 35 lines (+1/-11)
2 files modified
hooks/hooks.py (+0/-10)
hooks/install (+1/-1)
Reviewer Review Type Date Requested Status
Xav Paice (community) Approve
Review via email: mp+387692@code.launchpad.net

This proposal has been superseded by a proposal from 2020-07-23.

Commit message

Add python3-pip to install hook to support trusty fresh installs.

Description of the change

Addressing Andrea's note for install hook to add in py3-pip package on top of Zach's fix for trusty upgrade-charm imports.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

Revision history for this message
Xav Paice (xavpaice) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Failed to merge change (unable to merge source repository due to conflicts), setting status to needs review.

Unmerged commits

db223eb... by Drew Freiberger

Add python3-pip to list of installed packages

893375c... by Zachary Zehring

Add try/except around pip import and reorder distro import.

This ensures python3-pip is installed as this package is
missing from trusty series, which will break upgrades from
older charm revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/hooks.py b/hooks/hooks.py
2index 086f76c..1868585 100755
3--- a/hooks/hooks.py
4+++ b/hooks/hooks.py
5@@ -18,17 +18,7 @@ import sys
6 import time
7
8 try:
9-<<<<<<< hooks/hooks.py
10- import distro
11-except ImportError:
12- pip.main(['install', "distro"])
13- import distro
14-
15-try:
16- import yaml
17-=======
18 import yaml # flake8: noqa
19->>>>>>> hooks/hooks.py
20 except ImportError:
21 if sys.version_info.major == 2:
22 subprocess.check_call(['apt-get', 'install', '-y', 'python-yaml'])
23diff --git a/hooks/install b/hooks/install
24index baffb57..8a1f051 100755
25--- a/hooks/install
26+++ b/hooks/install
27@@ -2,7 +2,7 @@
28 # Wrapper to deal with newer Ubuntu versions that don't have py2 installed
29 # by default.
30
31-declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml')
32+declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml' 'python3-pip')
33
34 wait_for_dpkg_unlock() {
35 while $(fuser -s /var/lib/dpkg/lock); do sleep .5;done

Subscribers

People subscribed via source and target branches

to all changes: