Code review comment for lp:~blake-rouse/maas/ppc64el-grub

Revision history for this message
Gavin Panella (allenap) wrote :

Looks good! I think [8] needs fixing, but I'll mark this approved
because I don't want to delay you once you've fixed it.

[8]

+        ppc64el_module.tempdir = tempdir

Use self.patch() here too; I think this will leak otherwise.

[9]

+        tmp = tempfile.mkdtemp('', 'maas-test-')
+        dest = tempfile.mkdtemp('', 'maas-test-')
...
+        rmtree(tmp)
+        rmtree(dest)

Fwiw, the call to rmtree should be put into a clean-up as soon as the
directory is created, so that a test failure doesn't leave detritus
around. For example:

        tmp = tempfile.mkdtemp('', 'maas-test-')
        self.addCleanup(rmtree, tmp)

However, look at MAASTestCase.make_dir(). This does what you need.

review: Approve

« Back to merge proposal