From b2eea8efa6fd45a3d4afbd88352b6d22e9ae4b81 Mon Sep 17 00:00:00 2001 From: Eric Price Date: Mon, 23 Jun 2008 21:28:19 -0400 Subject: [PATCH] More accurate validMachineName (no _, 63 character limit). svn path=/trunk/packages/sipb-xen-www/; revision=648 --- code/validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/validation.py b/code/validation.py index 9b703ad..e69559a 100644 --- a/code/validation.py +++ b/code/validation.py @@ -135,8 +135,8 @@ def validMachineName(name): """Check that name is valid for a machine name""" if not name: return False - charset = string.ascii_letters + string.digits + '-_' - if name[0] in '-_' or len(name) > 22: + charset = string.lowercase + string.digits + '-' + if '-' in (name[0], name[-1]) or len(name) > 63: return False for x in name: if x not in charset: -- 1.7.9.5