Synced with jamespage on that and he suggested an alternative approach, since we already interact with juju via `juju-run` from the script that gets executed via a cron job, we could steal proxy settings from the `juju-run` environment.
This allows us to query proxy settings dynamically and have the latest in-agent version at the time of the sync script invocation - this means we don't have to wait until proxy settings change notifications appear in Juju to fix this or do a subjective change to juju to write to /etc/juju-proxy.conf.
Synced with jamespage on that and he suggested an alternative approach, since we already interact with juju via `juju-run` from the script that gets executed via a cron job, we could steal proxy settings from the `juju-run` environment.
https:/ /opendev. org/openstack/ charm-glance- simplestreams- sync/src/ branch/ stable/ 20.05/files/ glance- simplestreams- sync.py# L373
I checked that proxy settings are available from the unit context in a juju-run invocation:
$ sudo juju-run <unit-name> env | grep _PROXY FTP_PROXY= HTTPS_PROXY= HTTP_PROXY= NO_PROXY= 10.0.0. 0/8,192. 168.0.0/ 16,172. 16.0.0/ 12
JUJU_CHARM_
JUJU_CHARM_
JUJU_CHARM_
JUJU_CHARM_
This allows us to query proxy settings dynamically and have the latest in-agent version at the time of the sync script invocation - this means we don't have to wait until proxy settings change notifications appear in Juju to fix this or do a subjective change to juju to write to /etc/juju- proxy.conf.