---
 PVE/Storage/DRBDPlugin.pm | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/PVE/Storage/DRBDPlugin.pm b/PVE/Storage/DRBDPlugin.pm
index 565fb4c..91addc5 100644
--- a/PVE/Storage/DRBDPlugin.pm
+++ b/PVE/Storage/DRBDPlugin.pm
@@ -304,15 +304,11 @@ sub activate_volume {
     
     my $hdl = connect_drbdmanage_service();
     my $nodename = PVE::INotify::nodename();
-    my ($rc, $res) = $hdl->list_assignments([$nodename], [], 0, {}, []);
+    my ($rc, $res) = $hdl->list_assignments([$nodename], [$volname], 0, {}, 
[]);
     check_drbd_res($rc);
 
-    foreach my $entry (@$res) {
-       my ($node, $res_name, $props, $voldata) = @$entry;
-       if (($node eq $nodename) && ($res_name eq $volname)) {
-           return undef; # assignment already exists
-       }
-    }
+# assignment already exists?
+    return undef if @$res;
 
     # create diskless assignment
     ($rc, $res) = $hdl->assign($nodename, $volname, { diskless => 'true' });
-- 
2.6.1

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to