diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-12-26 17:45:10 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-12-26 18:15:36 +0200 |
commit | dbd82deb8230f01b2e12d50ada2d31f6e15cad17 (patch) | |
tree | b2214a20ff6d6893088d7334f47e521a78ab7a95 | |
parent | 9dfdf7c1e93ca619f1829126423398036d4e4a79 (diff) | |
download | vmdb2-dbd82deb8230f01b2e12d50ada2d31f6e15cad17.tar.gz |
Refactor: rename tags mount point to builder mount point
-rw-r--r-- | vmdb/plugins/mount_plugin.py | 2 | ||||
-rw-r--r-- | vmdb/tags.py | 10 | ||||
-rw-r--r-- | vmdb/tags_tests.py | 16 |
3 files changed, 14 insertions, 14 deletions
diff --git a/vmdb/plugins/mount_plugin.py b/vmdb/plugins/mount_plugin.py index 0fbfb8d..6baf046 100644 --- a/vmdb/plugins/mount_plugin.py +++ b/vmdb/plugins/mount_plugin.py @@ -67,7 +67,7 @@ class MountStepRunner(vmdb.StepRunnerInterface): mount_point = tempfile.mkdtemp() vmdb.runcmd(['mount', device, mount_point]) - state.tags.set_mount_point(tag, mount_point, cached=True) + state.tags.set_builder_mount_point(tag, mount_point, cached=True) state.tags.set_target_mount_point(tag, dirname) return mount_point diff --git a/vmdb/tags.py b/vmdb/tags.py index 9ac3a80..27b866d 100644 --- a/vmdb/tags.py +++ b/vmdb/tags.py @@ -40,7 +40,7 @@ class Tags: def get_mount_point(self, tag): item = self._get(tag) - return item['mount_point'] + return item['builder_mount_point'] def get_fstype(self, tag): item = self._get(tag) @@ -60,7 +60,7 @@ class Tags: self._tagnames.append(tag) self._tags[tag] = { 'dev': None, - 'mount_point': None, + 'builder_mount_point': None, 'fstype': None, 'target_mount_point': None, } @@ -71,11 +71,11 @@ class Tags: raise AlreadyHasDev(tag) item['dev'] = dev - def set_mount_point(self, tag, mount_point, cached=False): + def set_builder_mount_point(self, tag, mount_point, cached=False): item = self._get(tag) - if item['mount_point'] is not None: + if item['builder_mount_point'] is not None: raise AlreadyMounted(tag) - item['mount_point'] = mount_point + item['builder_mount_point'] = mount_point item['cached'] = cached def set_fstype(self, tag, fstype): diff --git a/vmdb/tags_tests.py b/vmdb/tags_tests.py index 383ac14..cb4a1dd 100644 --- a/vmdb/tags_tests.py +++ b/vmdb/tags_tests.py @@ -68,7 +68,7 @@ class TagsTests(unittest.TestCase): def test_adds_mount_point(self): tags = vmdb.Tags() tags.append('first') - tags.set_mount_point('first', '/mnt/foo') + tags.set_builder_mount_point('first', '/mnt/foo') self.assertEqual(tags.get_tags(), ['first']) self.assertEqual(tags.get_dev('first'), None) self.assertEqual(tags.get_mount_point('first'), '/mnt/foo') @@ -76,13 +76,13 @@ class TagsTests(unittest.TestCase): def test_mount_point_is_uncached_by_default(self): tags = vmdb.Tags() tags.append('first') - tags.set_mount_point('first', '/mnt/foo') + tags.set_builder_mount_point('first', '/mnt/foo') self.assertFalse(tags.is_cached('first')) def test_mount_point_can_be_made_cached(self): tags = vmdb.Tags() tags.append('first') - tags.set_mount_point('first', '/mnt/foo', cached=True) + tags.set_builder_mount_point('first', '/mnt/foo', cached=True) self.assertTrue(tags.is_cached('first')) def test_set_dev_raises_error_for_unknown_tag(self): @@ -90,17 +90,17 @@ class TagsTests(unittest.TestCase): with self.assertRaises(vmdb.UnknownTag): tags.set_dev('first', '/mnt/foo') - def test_set_mount_point_raises_error_for_unknown_tag(self): + def test_set_builder_mount_point_raises_error_for_unknown_tag(self): tags = vmdb.Tags() with self.assertRaises(vmdb.UnknownTag): - tags.set_mount_point('first', '/mnt/foo') + tags.set_builder_mount_point('first', '/mnt/foo') - def test_set_mount_point_raises_error_for_double_mount(self): + def test_set_builder_mount_point_raises_error_for_double_mount(self): tags = vmdb.Tags() tags.append('first') - tags.set_mount_point('first', '/mnt/foo') + tags.set_builder_mount_point('first', '/mnt/foo') with self.assertRaises(vmdb.AlreadyMounted): - tags.set_mount_point('first', '/mnt/foo') + tags.set_builder_mount_point('first', '/mnt/foo') def test_set_dev_raises_error_for_double_dev(self): tags = vmdb.Tags() |