@@ -1078,13 +1078,8 @@ def _test_plug_network(self, distro, mock_isfile, mock_int_by_mac,
1078
1078
# One Interface down, Happy Path
1079
1079
mode = stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP | stat .S_IROTH
1080
1080
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
1088
1083
1089
1084
m = self .useFixture (test_utils .OpenFixture (file_name )).mock_open
1090
1085
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,
1163
1158
1164
1159
mode = stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP | stat .S_IROTH
1165
1160
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
1172
1163
1173
1164
m = self .useFixture (test_utils .OpenFixture (file_name )).mock_open
1174
1165
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,
1233
1224
1234
1225
mode = stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP | stat .S_IROTH
1235
1226
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
1242
1229
1243
1230
m = self .useFixture (test_utils .OpenFixture (file_name )).mock_open
1244
1231
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,
1376
1363
1377
1364
def test_ubuntu_plug_network_host_routes (self ):
1378
1365
self ._test_plug_network_host_routes (consts .UBUNTU )
1379
- self .conf .config (group = "amphora_agent" ,
1380
- agent_server_network_file = "/path/to/interfaces_file" )
1381
1366
1382
1367
def test_centos_plug_network_host_routes (self ):
1383
1368
self ._test_plug_network_host_routes (consts .CENTOS )
@@ -1631,13 +1616,9 @@ def _test_plug_VIP4(self, distro, mock_isfile, mock_makedirs,
1631
1616
1632
1617
mode = stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP | stat .S_IROTH
1633
1618
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
1641
1622
1642
1623
m = self .useFixture (test_utils .OpenFixture (file_name )).mock_open
1643
1624
@@ -1749,14 +1730,9 @@ def _test_plug_VIP4(self, distro, mock_isfile, mock_makedirs,
1749
1730
# One Interface down, Happy Path IPv4
1750
1731
mode = stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP | stat .S_IROTH
1751
1732
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
1760
1736
1761
1737
m = self .useFixture (test_utils .OpenFixture (file_name )).mock_open
1762
1738
0 commit comments