- allow capital letters in slice names
authorTony Mack <tmack@cs.princeton.edu>
Thu, 26 Apr 2007 18:25:56 +0000 (18:25 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Thu, 26 Apr 2007 18:25:56 +0000 (18:25 +0000)
PLC/Methods/AddSlice.py
PLC/Slices.py

index 9567c09..5642519 100644 (file)
@@ -42,11 +42,11 @@ class AddSlice(Method):
         slice_fields = dict(filter(can_update, slice_fields.items()))
 
         # 1. Lowercase.
-        # 2. Begins with login_base (only letters).
+        # 2. Begins with login_base (letters or numbers).
         # 3. Then single underscore after login_base.
         # 4. Then letters, numbers, or underscores.
         name = slice_fields['name']
-        good_name = r'^[a-z0-9]+_[a-z0-9_]+$'
+        good_name = r'^[a-z0-9]+_[a-zA-Z0-9_]+$'
         if not name or \
            not re.match(good_name, name):
             raise PLCInvalidArgument, "Invalid slice name"
index c8f6e81..d3b6f78 100644 (file)
@@ -61,7 +61,7 @@ class Slice(Row):
         # 2. Begins with login_base (letters or numbers).
         # 3. Then single underscore after login_base.
         # 4. Then letters, numbers, or underscores.
-        good_name = r'^[a-z0-9]+_[a-z0-9_]+$'
+        good_name = r'^[a-z0-9]+_[a-zA-Z0-9_]+$'
         if not name or \
            not re.match(good_name, name):
             raise PLCInvalidArgument, "Invalid slice name"