Skip to content

Commit cc52d7a

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove deprecated [amphora_agent] agent_server_network_file"
2 parents 1b09ba8 + fc7c619 commit cc52d7a

File tree

3 files changed

+17
-44
lines changed

3 files changed

+17
-44
lines changed

octavia/common/config.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,6 @@
148148
cfg.StrOpt('agent_server_network_dir',
149149
help=_("The directory where new network interfaces "
150150
"are located")),
151-
cfg.StrOpt('agent_server_network_file',
152-
help=_("The file where the network interfaces are located. "
153-
"Specifying this will override any value set for "
154-
"agent_server_network_dir."),
155-
deprecated_for_removal=True,
156-
deprecated_reason=_('New amphora interface management '
157-
'does not support single interface file.'),
158-
deprecated_since='Xena'),
159151
cfg.IntOpt('agent_request_read_timeout', default=180,
160152
help=_("The time in seconds to allow a request from the "
161153
"controller to run before terminating the socket.")),

octavia/tests/functional/amphorae/backend/agent/api_server/test_server.py

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,13 +1078,8 @@ def _test_plug_network(self, distro, mock_isfile, mock_int_by_mac,
10781078
# One Interface down, Happy Path
10791079
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
10801080

1081-
if self.conf.conf.amphora_agent.agent_server_network_file:
1082-
file_name = self.conf.conf.amphora_agent.agent_server_network_file
1083-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
1084-
1085-
else:
1086-
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
1087-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
1081+
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
1082+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
10881083

10891084
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
10901085
with mock.patch('os.open') as mock_open, mock.patch.object(
@@ -1163,12 +1158,8 @@ def _test_plug_network(self, distro, mock_isfile, mock_int_by_mac,
11631158

11641159
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
11651160

1166-
if self.conf.conf.amphora_agent.agent_server_network_file:
1167-
file_name = self.conf.conf.amphora_agent.agent_server_network_file
1168-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
1169-
else:
1170-
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
1171-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
1161+
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
1162+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
11721163

11731164
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
11741165
with mock.patch('os.open') as mock_open, mock.patch.object(
@@ -1233,12 +1224,8 @@ def _test_plug_network(self, distro, mock_isfile, mock_int_by_mac,
12331224

12341225
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
12351226

1236-
if self.conf.conf.amphora_agent.agent_server_network_file:
1237-
file_name = self.conf.conf.amphora_agent.agent_server_network_file
1238-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
1239-
else:
1240-
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
1241-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
1227+
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
1228+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
12421229

12431230
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
12441231
with mock.patch('os.open') as mock_open, mock.patch.object(
@@ -1376,8 +1363,6 @@ def _test_plug_network(self, distro, mock_isfile, mock_int_by_mac,
13761363

13771364
def test_ubuntu_plug_network_host_routes(self):
13781365
self._test_plug_network_host_routes(consts.UBUNTU)
1379-
self.conf.config(group="amphora_agent",
1380-
agent_server_network_file="/path/to/interfaces_file")
13811366

13821367
def test_centos_plug_network_host_routes(self):
13831368
self._test_plug_network_host_routes(consts.CENTOS)
@@ -1631,13 +1616,9 @@ def _test_plug_VIP4(self, distro, mock_isfile, mock_makedirs,
16311616

16321617
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
16331618

1634-
if self.conf.conf.amphora_agent.agent_server_network_file:
1635-
file_name = self.conf.conf.amphora_agent.agent_server_network_file
1636-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
1637-
else:
1638-
file_name = ('/etc/octavia/interfaces/{netns_int}.json'.format(
1639-
netns_int=consts.NETNS_PRIMARY_INTERFACE))
1640-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
1619+
file_name = ('/etc/octavia/interfaces/{netns_int}.json'.format(
1620+
netns_int=consts.NETNS_PRIMARY_INTERFACE))
1621+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
16411622

16421623
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
16431624

@@ -1749,14 +1730,9 @@ def _test_plug_VIP4(self, distro, mock_isfile, mock_makedirs,
17491730
# One Interface down, Happy Path IPv4
17501731
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
17511732

1752-
if self.conf.conf.amphora_agent.agent_server_network_file:
1753-
file_name = self.conf.conf.amphora_agent.agent_server_network_file
1754-
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
1755-
1756-
else:
1757-
file_name = ('/etc/octavia/interfaces/'
1758-
'{}.json'.format(consts.NETNS_PRIMARY_INTERFACE))
1759-
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
1733+
file_name = ('/etc/octavia/interfaces/{}.json'.format(
1734+
consts.NETNS_PRIMARY_INTERFACE))
1735+
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
17601736

17611737
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
17621738

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
upgrade:
3+
- |
4+
The deprecated ``[amphora_agent] agent_server_network_file`` option has
5+
been removed.

0 commit comments

Comments
 (0)