charm doesn't honor juju-proxy-* settings

Bug #1944591 reported by Giuseppe Petralia
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
charm-ubuntu-advantage
Fix Committed
Medium
Jose Guedez

Bug Description

Charm fails to install behind proxy when juju model-config juju-proxy-* are configured.

i.e.

this was failing
def install_ppa(ppa):
    """Install specified ppa"""
    subprocess.check_call(["add-apt-repository", "--yes", ppa)

Workaround was defining an env object and pass to subprocess.check_call doing add-apt-repository and ubuntu-advantage commands like this:

import os

env = dict(os.environ)
proxy = "http://proxy.com:3128/"
env['http_proxy'] = proxy
env['https_proxy'] = proxy

def install_ppa(ppa):
    """Install specified ppa"""
    subprocess.check_call(["add-apt-repository", "--yes", ppa], env=env)

Tags: bseng-67

Related branches

Revision history for this message
Bartosz Woronicz (mastier1) wrote (last edit ):
Revision history for this message
Bartosz Woronicz (mastier1) wrote :
Tom Haddon (mthaddon)
Changed in charm-ubuntu-advantage:
status: New → Confirmed
importance: Undecided → Medium
Jose Guedez (jfguedez)
Changed in charm-ubuntu-advantage:
assignee: nobody → Jose Guedez (jfguedez)
status: Confirmed → Fix Committed
Alvaro Uria (aluria)
tags: added: bseng-67
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.