[pve-devel] [PATCH 18/20] cloudinit: parse_volume_id can fail (eg on 'none')

Alexandre Derumier aderumier at odiso.com
Thu Jul 27 17:06:51 CEST 2017


From: Wolfgang Bumiller <w.bumiller at proxmox.com>

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 8fb47b5..6aa0128 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6696,7 +6696,7 @@ sub generate_cloudinitconfig {
 
 	my ($storeid, $volname) = PVE::Storage::parse_volume_id($drive->{file}, 1);
 
-	return if $volname !~ m/vm-$vmid-cloudinit/;
+	return if !$volname || $volname !~ m/vm-$vmid-cloudinit/;
 
 	my $path = "/tmp/cloudinit/$vmid";
 
-- 
2.11.0




More information about the pve-devel mailing list