Remove deprecated [amphora_agent] agent_server_network_file

The option was deprecated in Xena release[1] and has had no effect
since then.

[1] 5dd7ad9ad8

Change-Id: I2fbbfc297dcf8c33de81d883a55bb7bac9dfc4ca
This commit is contained in:
Takashi Kajinami
2024-05-05 15:51:06 +09:00
parent fcc61e9ca8
commit fc7c61993e
3 changed files with 17 additions and 44 deletions

View File

@@ -148,14 +148,6 @@ amphora_agent_opts = [
cfg.StrOpt('agent_server_network_dir',
help=_("The directory where new network interfaces "
"are located")),
cfg.StrOpt('agent_server_network_file',
help=_("The file where the network interfaces are located. "
"Specifying this will override any value set for "
"agent_server_network_dir."),
deprecated_for_removal=True,
deprecated_reason=_('New amphora interface management '
'does not support single interface file.'),
deprecated_since='Xena'),
cfg.IntOpt('agent_request_read_timeout', default=180,
help=_("The time in seconds to allow a request from the "
"controller to run before terminating the socket.")),

View File

@@ -1078,13 +1078,8 @@ class TestServerTestCase(base.TestCase):
# One Interface down, Happy Path
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
if self.conf.conf.amphora_agent.agent_server_network_file:
file_name = self.conf.conf.amphora_agent.agent_server_network_file
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
else:
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
with mock.patch('os.open') as mock_open, mock.patch.object(
@@ -1163,12 +1158,8 @@ class TestServerTestCase(base.TestCase):
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
if self.conf.conf.amphora_agent.agent_server_network_file:
file_name = self.conf.conf.amphora_agent.agent_server_network_file
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
else:
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
with mock.patch('os.open') as mock_open, mock.patch.object(
@@ -1233,12 +1224,8 @@ class TestServerTestCase(base.TestCase):
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
if self.conf.conf.amphora_agent.agent_server_network_file:
file_name = self.conf.conf.amphora_agent.agent_server_network_file
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
else:
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
file_name = f'/etc/octavia/interfaces/eth{test_int_num}.json'
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
with mock.patch('os.open') as mock_open, mock.patch.object(
@@ -1376,8 +1363,6 @@ class TestServerTestCase(base.TestCase):
def test_ubuntu_plug_network_host_routes(self):
self._test_plug_network_host_routes(consts.UBUNTU)
self.conf.config(group="amphora_agent",
agent_server_network_file="/path/to/interfaces_file")
def test_centos_plug_network_host_routes(self):
self._test_plug_network_host_routes(consts.CENTOS)
@@ -1631,13 +1616,9 @@ class TestServerTestCase(base.TestCase):
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
if self.conf.conf.amphora_agent.agent_server_network_file:
file_name = self.conf.conf.amphora_agent.agent_server_network_file
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
else:
file_name = ('/etc/octavia/interfaces/{netns_int}.json'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE))
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
file_name = ('/etc/octavia/interfaces/{netns_int}.json'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE))
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open
@@ -1749,14 +1730,9 @@ class TestServerTestCase(base.TestCase):
# One Interface down, Happy Path IPv4
mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
if self.conf.conf.amphora_agent.agent_server_network_file:
file_name = self.conf.conf.amphora_agent.agent_server_network_file
flags = os.O_WRONLY | os.O_CREAT | os.O_APPEND
else:
file_name = ('/etc/octavia/interfaces/'
'{}.json'.format(consts.NETNS_PRIMARY_INTERFACE))
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
file_name = ('/etc/octavia/interfaces/{}.json'.format(
consts.NETNS_PRIMARY_INTERFACE))
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
m = self.useFixture(test_utils.OpenFixture(file_name)).mock_open

View File

@@ -0,0 +1,5 @@
---
upgrade:
- |
The deprecated ``[amphora_agent] agent_server_network_file`` option has
been removed.