Hello community,

here is the log from the commit of package yast2-storage for openSUSE:Factory 
checked in at 2014-02-26 23:20:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-storage.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-storage"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage/yast2-storage.changes      
2014-02-23 07:16:27.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-storage.new/yast2-storage.changes 
2014-02-26 23:20:31.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Feb 24 16:15:28 CET 2014 - aschn...@suse.de
+
+- disallow to create and delete partitions on ECKD DASDs if other
+  partitions on the DASD are busy
+
+-------------------------------------------------------------------
@@ -4 +10 @@
-- fixed naming of new partitions on DASDs
+- fixed naming of new partitions on ECKD DASDs

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-storage-3.1.10.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-3.1.10/package/yast2-storage.changes 
new/yast2-storage-3.1.10/package/yast2-storage.changes
--- old/yast2-storage-3.1.10/package/yast2-storage.changes      2014-02-21 
18:04:47.000000000 +0100
+++ new/yast2-storage-3.1.10/package/yast2-storage.changes      2014-02-24 
17:54:58.000000000 +0100
@@ -1,7 +1,13 @@
 -------------------------------------------------------------------
+Mon Feb 24 16:15:28 CET 2014 - aschn...@suse.de
+
+- disallow to create and delete partitions on ECKD DASDs if other
+  partitions on the DASD are busy
+
+-------------------------------------------------------------------
 Fri Feb 21 15:12:11 CET 2014 - aschn...@suse.de
 
-- fixed naming of new partitions on DASDs
+- fixed naming of new partitions on ECKD DASDs
 - adapted to libstorage change
 
 -------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-3.1.10/src/include/partitioning/ep-hd-lib.rb 
new/yast2-storage-3.1.10/src/include/partitioning/ep-hd-lib.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-hd-lib.rb      
2014-02-21 18:04:47.000000000 +0100
+++ new/yast2-storage-3.1.10/src/include/partitioning/ep-hd-lib.rb      
2014-02-24 17:54:58.000000000 +0100
@@ -253,14 +253,12 @@
         :to   => "map <string, any>"
       )
 
-      if Storage.IsUsedBy(disk)
-        # error popup
-        Popup.Error(_("The disk is in use and cannot be modified."))
+      if Ops.get_boolean(disk, "readonly", false)
+        Popup.Error(Partitions.RdonlyText(disk, true))
         return
       end
 
-      if Ops.get_boolean(disk, "readonly", false)
-        Popup.Error(Partitions.RdonlyText(disk, true))
+      if !Storage.CanCreate(disk, true)
         return
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-3.1.10/src/modules/Storage.rb 
new/yast2-storage-3.1.10/src/modules/Storage.rb
--- old/yast2-storage-3.1.10/src/modules/Storage.rb     2014-02-21 
18:04:47.000000000 +0100
+++ new/yast2-storage-3.1.10/src/modules/Storage.rb     2014-02-24 
17:54:58.000000000 +0100
@@ -5148,6 +5148,39 @@
     end
 
 
+    def CanCreate(disk, verbose)
+
+      ret = true
+
+      if ret && IsUsedBy(disk)
+        if verbose
+          # TRANSLATORS: error popup
+          txt = _("The disk is in use and cannot be modified.")
+          Popup.Message(txt)
+        end
+        ret = false
+      end
+
+      if ret && disk.fetch("label", "") == "dasd"
+        if disk.fetch("partitions", []).any? do |partition|
+            !DeviceMounted(partition["device"]).empty? || IsUsedBy(partition)
+          end
+          if verbose
+            # TRANSLATORS: error popup
+            txt = _("Partitions cannot be created since other partitions on 
the disk are used.")
+            Popup.Message(txt)
+          end
+          ret = false
+        end
+      end
+
+      log.info("CanCreate device:#{disk["device"]} verbose:#{verbose} 
ret:#{ret}")
+
+      return ret
+
+    end
+
+
     def CanEdit(p, verbose)
       p = deep_copy(p)
       ret = true
@@ -5265,23 +5298,24 @@
         end
       end
 
-      if ret && verbose &&
-          Builtins.substring(Ops.get_string(disk, "device", ""), 0, 9) == 
"/dev/dasd"
-        if Builtins.find(Ops.get_list(disk, "partitions", [])) do |partition|
+      if ret && disk.fetch("label", "") == "dasd"
+        if disk.fetch("partitions", []).any? do |partition|
             Ops.get_string(partition, "device", "") !=
               Ops.get_string(p, "device", "") &&
-              IsUsedBy(partition)
-          end != nil
-          txt = Builtins.sformat(
-            _(
-              "\n" +
-                "Partition %1 cannot be removed since other partitions on 
the\n" +
-                "disk %2 are used.\n"
-            ),
-            Ops.get_string(p, "device", ""),
-            Ops.get_string(disk, "device", "")
-          )
+              !DeviceMounted(partition["device"]).empty? || IsUsedBy(partition)
+          end
+          if verbose
+            txt = Builtins.sformat(
+              _(
+                "\n" +
+                  "Partition %1 cannot be removed since other partitions on 
the\n" +
+                  "disk %2 are used.\n"
+                ),
+              Ops.get_string(p, "device", ""),
+              Ops.get_string(disk, "device", "")
+            )
           Popup.Message(txt)
+          end
           ret = false
         end
       end
@@ -7229,6 +7263,7 @@
     publish :function => :SetVolOptions, :type => "map (map, string, symbol, 
string, string, string)"
     publish :function => :IsUsedBy, :type => "boolean (map)"
     publish :function => :TryUnaccessSwap, :type => "boolean (string)"
+    publish :function => :CanCreate, :type => "boolean (map, boolean)"
     publish :function => :CanEdit, :type => "boolean (map, boolean)"
     publish :function => :CanDelete, :type => "boolean (map, map, boolean)"
     publish :function => :ReadFstab, :type => "list <map> (string)"

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to