From 04dc8c02ed7ef713f3719e0009737d7a8f00832f Mon Sep 17 00:00:00 2001 From: Drew Freiberger Date: Tue, 23 Oct 2018 11:37:14 -0500 Subject: [PATCH] Ignore proxy for charm peer communication Designate-bind services use http communication to manage initial zone transfers from the leader to other units. This should be done within the space designated for dns-backend in the charm bindings. To ensure this, we must bypass proxy configurations when using wget between units by adding --no-proxy flag to the wget command. Change-Id: I3cebb1e01ffde9a9585f152451bf9bcebbdd3f58 Closes-Bug: #1796969 --- src/lib/charm/openstack/designate_bind.py | 4 +++- unit_tests/test_lib_charm_openstack_designate_bind.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/charm/openstack/designate_bind.py b/src/lib/charm/openstack/designate_bind.py index d3ff273..c5eb7ce 100644 --- a/src/lib/charm/openstack/designate_bind.py +++ b/src/lib/charm/openstack/designate_bind.py @@ -418,7 +418,9 @@ class DesignateBindCharm(openstack_charm.OpenStackCharm): :returns: None """ print("{} {}".format(url, target_dir)) - cmd = ['wget', url, '--retry-connrefused', '-t', '10'] + # set arg no-proxy as this should be a direct connection on + # dns-backend space lp#1796969 + cmd = ['wget', url, '--no-proxy', '--retry-connrefused', '-t', '10'] subprocess.check_call(cmd, cwd=target_dir) def retrieve_zones(self, cluster_relation=None): diff --git a/unit_tests/test_lib_charm_openstack_designate_bind.py b/unit_tests/test_lib_charm_openstack_designate_bind.py index 260bcac..b1647b6 100644 --- a/unit_tests/test_lib_charm_openstack_designate_bind.py +++ b/unit_tests/test_lib_charm_openstack_designate_bind.py @@ -367,8 +367,8 @@ class TestDesignateBindCharm(Helper): a = designate_bind.DesignateBindCharm() a.wget_file('http://ip1/tarfile.tar', '/tmp') self.check_call.assert_called_once_with( - ['wget', 'http://ip1/tarfile.tar', '--retry-connrefused', '-t', - '10'], + ['wget', 'http://ip1/tarfile.tar', '--no-proxy', + '--retry-connrefused', '-t', '10'], cwd='/tmp' )