Merge pull request #467 from vitaminmoo/create-disk-dev-dir

Create device dirs if they do not exist
This commit is contained in:
Anders Ingemann 2018-05-02 20:30:04 +02:00 committed by GitHub
commit 161c787906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,7 @@ class BasePartition(AbstractPartition):
# $GRUB_DEVICE_UUID when creating /boot/grub/grub.cfg
self.disk_by_uuid_path = os.path.join('/dev/disk/by-uuid', self.get_uuid())
if not os.path.exists(self.disk_by_uuid_path):
os.makedirs(os.path.dirname(self.disk_by_uuid_path))
os.symlink(self.device_path, self.disk_by_uuid_path)
def unlink_uuid(self):