Author: aschnell
Date: Wed Jun 25 16:50:07 2008
New Revision: 48535
URL: http://svn.opensuse.org/viewcvs/yast?rev=48535&view=rev
Log:
- check volume group name
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/lvm_lib.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp?rev=48535&r1=48534&r2=48535&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp Wed Jun 25 16:50:07 2008
@@ -8,6 +8,64 @@
textdomain "storage";
+ boolean CheckVgName(string name)
+ {
+ if (size(name) == 0)
+ {
+ // error popup text
+ Error(_("Enter a name for the volume group."));
+ return false;
+ }
+
+ if (size(name) > 128)
+ {
+ // error popup text
+ Error(_("The name for the volume group is longer than 128 characters."));
+ return false;
+ }
+
+ if (substring(name, 0, 1) == "-")
+ {
+ // error popup text
+ Error(_("The name for the volume group must not start with a \"-\"."));
+ return false;
+ }
+
+ string allowed_chars = "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
+ "abcdefghijklmnopqrstuvwxyz" + "._-+";
+ if (findfirstnotof(name, allowed_chars) != nil)
+ {
+ // error popup text
+ Error(_("The name for the volume group contains illegal characters. Allowed
+are alphanumeric characters, \".\", \"_\", \"-\" and \"+\"."));
+ return false;
+ }
+
+ return true;
+ }
+
+
+ boolean CheckVgNameConflict(string name, list<string> vgs)
+ {
+ if (contains(vgs, name))
+ {
+ // error popup text
+ Error(sformat(_("The volume group \"%1\" already exists."), name ));
+ return false;
+ }
+
+ if (!check_vgname_dev(name))
+ {
+ // error popup text
+ Error(sformat(_("The volume group name \"%1\" conflicts
+with another entry in the /dev directory.\n"), name));
+ return false;
+ }
+
+ return true;
+ }
+
+
boolean CheckPeSize(integer pe_size)
{
if (!Integer::IsPowerOfTwo(pe_size) || pe_size < 1024)
@@ -41,7 +99,11 @@
{
y2milestone("MiniWorkflowStepVg data:%1", data);
- string vgname = "";
+ map