From 13901cd4465288b634103c1997a5653500f2b5cc Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 12 Dec 2016 11:18:45 +0100 Subject: [PATCH] =?utf8?q?r2lab=20is=20migrating=20from=20a=20previous=20d?= =?utf8?q?epl.=20based=20on=20omf=5Fsfa=20and=20so=20it=20comes=20with=20r?= =?utf8?q?ather=20long=20dot-separated=20names=20allow=20=E2=80=98.?= =?utf8?q?=E2=80=99=20on=20both=20sides=20of=20the=20=5F=20in=20slice=20na?= =?utf8?q?mes,=20and=20so=20also=20allow=20=E2=80=98.=E2=80=99=20in=20site?= =?utf8?q?=20login=5Fbase?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- PLC/Methods/AddSlice.py | 2 +- PLC/Sites.py | 4 ++-- PLC/Slices.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PLC/Methods/AddSlice.py b/PLC/Methods/AddSlice.py index 0d6c1c6..51918f4 100644 --- a/PLC/Methods/AddSlice.py +++ b/PLC/Methods/AddSlice.py @@ -63,7 +63,7 @@ class AddSlice(Method): # 3. Then single underscore after login_base. # 4. Then letters, numbers, or underscores. name = slice_fields['name'] - good_name = r'^[a-z0-9]+_[a-zA-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" diff --git a/PLC/Sites.py b/PLC/Sites.py index 969b2a9..2075409 100644 --- a/PLC/Sites.py +++ b/PLC/Sites.py @@ -69,8 +69,8 @@ class Site(Row): if not len(login_base): raise PLCInvalidArgument, "Login base must be specified" - if not set(login_base).issubset(string.lowercase + string.digits): - raise PLCInvalidArgument, "Login base must consist only of lowercase ASCII letters or numbers" + if not set(login_base).issubset(string.lowercase + string.digits + '.'): + raise PLCInvalidArgument, "Login base must consist only of lowercase ASCII letters or numbers or dots" conflicts = Sites(self.api, [login_base]) for site in conflicts: diff --git a/PLC/Slices.py b/PLC/Slices.py index 7226857..e5a51eb 100644 --- a/PLC/Slices.py +++ b/PLC/Slices.py @@ -60,7 +60,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-zA-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" -- 2.43.0