Merge ~codersquid/hexr/+git/submission-service-charm:duplicated-store-proxy into ~hexr-dev/hexr/+git/submission-service-charm:master

Proposed by Sheila Miguez
Status: Merged
Merged at revision: 28466249db2722c47d24dcbf34cb92b44a0f2e03
Proposed branch: ~codersquid/hexr/+git/submission-service-charm:duplicated-store-proxy
Merge into: ~hexr-dev/hexr/+git/submission-service-charm:master
Diff against target: 53 lines (+0/-29)
2 files modified
config.yaml (+0/-4)
reactive/submission_service.py (+0/-25)
Reviewer Review Type Date Requested Status
James Jesudason Pending
Review via email: mp+313388@code.launchpad.net

Commit message

remove proxy store code because it happens in the snap layer.

Description of the change

remove proxy store code because it happens in the snap layer.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index b1b605e..b2aafbd 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -1,8 +1,4 @@
6 options:
7- snap_store_proxy:
8- type: string
9- default: ""
10- description: "Proxy server for accessing the snap store. Optional."
11 submission_environment:
12 type: string
13 default: "dev"
14diff --git a/reactive/submission_service.py b/reactive/submission_service.py
15index e660aca..2352ae2 100644
16--- a/reactive/submission_service.py
17+++ b/reactive/submission_service.py
18@@ -55,9 +55,6 @@ def install_snap():
19 # expose the port that the service listens on
20 update_port()
21
22- # Set the proxy server and restart the snapd service, if required
23- set_proxy_server()
24-
25 snap.install(SNAP)
26
27 # let the user know if they need to add a database relation
28@@ -337,25 +334,3 @@ def get_database():
29 def update_port():
30 config = hookenv.config()
31 hookenv.open_port(config['submission_service_port'], protocol='TCP')
32-
33-
34-def set_proxy_server():
35- """Set up the proxy server for snapd.
36-
37- Some environments may need a proxy server to access the Snap Store. The
38- access is from snapd rather than the snap command, so the system-wide
39- environment file needs to be updated and snapd needs to be restarted.
40- """
41- config = hookenv.config()
42- if len(config.get('snap_store_proxy', "")) == 0:
43- return
44-
45- # Update the /etc/environment file
46- env_command = 'echo "{}={}" | sudo tee -a /etc/environment'
47- subprocess.check_output(
48- env_command.format('http_proxy', config['snap_store_proxy']), shell=True)
49- subprocess.check_output(
50- env_command.format('https_proxy', config['snap_store_proxy']), shell=True)
51-
52- # Restart the snapd service
53- service_restart('snapd')

Subscribers

People subscribed via source and target branches

to all changes: