Skip to content

Commit 7a402a3

Browse files
petrutlucian94claudiubelu
authored andcommitted
backup writer: update the list of lvm udev files to be deleted
The backup writer initialization will disable LVM udev rules used by the minion worker. The migrated replica disks may contain LVM volumes and we'll no longer be able to modify them while being used by LVM. We'll need to update the list of udev files to acommodate Ubuntu 24.04 workers.
1 parent 1f30360 commit 7a402a3

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

coriolis/providers/backup_writers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ def _disable_lvm_metad_udev_rule(ssh):
112112
"""
113113
rule_paths = [
114114
"/lib/udev/rules.d/69-lvm-metad.rules",
115-
"/lib/udev/rules.d/69-dm-lvm.rules"]
115+
"/lib/udev/rules.d/69-dm-lvm.rules",
116+
"/lib/udev/rules.d/69-lvm.rules",
117+
"/lib/udev/rules.d/56-lvm.rules",
118+
]
116119
for path in rule_paths:
117120
if utils.test_ssh_path(ssh, path):
118121
utils.exec_ssh_cmd(ssh, "sudo rm %s" % path, get_pty=True)

coriolis/tests/providers/test_backup_writers.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,24 @@ def test__disable_lvm2_lvmetad(self, mock_exec_ssh_cmd,
4949
@mock.patch('coriolis.utils.exec_ssh_cmd')
5050
def test__disable_lvm_metad_udev_rule(self, mock_exec_ssh_cmd,
5151
mock_test_ssh_path):
52-
rule_path = ["/lib/udev/rules.d/69-lvm-metad.rules",
53-
"/lib/udev/rules.d/69-dm-lvm.rules"]
52+
rule_paths = [
53+
"/lib/udev/rules.d/69-lvm-metad.rules",
54+
"/lib/udev/rules.d/69-dm-lvm.rules",
55+
"/lib/udev/rules.d/69-lvm.rules",
56+
"/lib/udev/rules.d/56-lvm.rules",
57+
]
5458
mock_test_ssh_path.return_value = True
5559

5660
backup_writers._disable_lvm_metad_udev_rule(self.mock_ssh)
5761

5862
mock_test_ssh_path.assert_has_calls(
59-
[mock.call(self.mock_ssh, rule_path[0]),
60-
mock.call(self.mock_ssh, rule_path[1])])
63+
[mock.call(self.mock_ssh, rule_path)
64+
for rule_path in rule_paths])
6165

6266
expected_calls = [
63-
mock.call(self.mock_ssh, 'sudo rm %s' % rule_path[0],
64-
get_pty=True),
65-
mock.call(self.mock_ssh, 'sudo rm %s' % rule_path[1],
66-
get_pty=True)]
67+
mock.call(self.mock_ssh, 'sudo rm %s' % rule_path,
68+
get_pty=True)
69+
for rule_path in rule_paths]
6770
mock_exec_ssh_cmd.assert_has_calls(expected_calls)
6871

6972
def test__check_deserialize_key(self):

0 commit comments

Comments
 (0)