Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coriolis/osmorphing/netpreserver/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _parse_iface_file(interface_file):
curr_ip_address = None
curr_iface = None
interfaces_contents = self.osmorphing_tool._read_file_sudo(
interface_file).decode()
interface_file)
LOG.debug(
"Fetched %s contents: %s", interface_file, interfaces_contents)
for line in interfaces_contents.splitlines():
Expand Down
6 changes: 3 additions & 3 deletions coriolis/tests/osmorphing/netpreserver/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_parse_network_basic(self, mock_test_path, mock_exec_cmd_chroot,
"iface eth1 inet dhcp\n"
"address 192.168.1.20/24\n"
)
mock_read_file_sudo.return_value = interfaces_content.encode()
mock_read_file_sudo.return_value = interfaces_content
mock_test_path.return_value = True
mock_exec_cmd_chroot.return_value = ""

Expand Down Expand Up @@ -109,7 +109,7 @@ def test_parse_network_with_source(self, mock_test_path,
mock_test_path.return_value = True
mock_exec_cmd_chroot.return_value = extra_file
mock_read_file_sudo.side_effect = (
main_content.encode(), extra_content.encode()
main_content, extra_content
)

self.netpreserver.parse_network()
Expand All @@ -136,7 +136,7 @@ def test_parse_network_with_trailing_hwaddress(self, mock_test_path,
interfaces_content = (
"hwaddress ether 00:11:22:33:44:55\n"
)
mock_read_file_sudo.return_value = interfaces_content.encode()
mock_read_file_sudo.return_value = interfaces_content
mock_test_path.return_value = True
mock_exec_cmd_chroot.return_value = ""

Expand Down
Loading