From 96588b2fa6a602e020403a9452dcb4b56b7d48c5 Mon Sep 17 00:00:00 2001 From: Ken Raffenetti Date: Mon, 13 Nov 2006 19:47:03 +0000 Subject: made form checking more generic for basic install git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2495 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Hostbase/hostbase/views.py | 14 -------------- src/lib/Server/Hostbase/regex.py | 3 --- 2 files changed, 17 deletions(-) diff --git a/src/lib/Server/Hostbase/hostbase/views.py b/src/lib/Server/Hostbase/hostbase/views.py index abb3adf6f..0d15fe106 100644 --- a/src/lib/Server/Hostbase/hostbase/views.py +++ b/src/lib/Server/Hostbase/hostbase/views.py @@ -682,20 +682,6 @@ def validate(request, new=False, host_id=None): and regex.host.match(request.POST['hostname'])): failures.append('hostname') - if not regex.printq.match(request.POST['printq']) and request.POST['printq']: - failures.append('printq') - - if not regex.user.match(request.POST['primary_user']): - failures.append('primary_user') - - if (not regex.user.match(request.POST['administrator']) - and request.POST['administrator']): - failures.append('administrator') - - if not (request.POST['location'] - and regex.location.match(request.POST['location'])): - failures.append('location') - if new: if (not regex.macaddr.match(request.POST['mac_addr_new']) and request.POST['mac_addr_new']): diff --git a/src/lib/Server/Hostbase/regex.py b/src/lib/Server/Hostbase/regex.py index 2d9614da9..9b983a6bd 100644 --- a/src/lib/Server/Hostbase/regex.py +++ b/src/lib/Server/Hostbase/regex.py @@ -2,8 +2,5 @@ import re date = re.compile('^[0-9]{4}-[0-9]{2}-[0-9]{2}$') host = re.compile('^[a-z0-9-_]+(\.[a-z0-9-_]+)+$') -printq = re.compile('^[a-z0-9-]+$') -user = re.compile('^[a-z0-9-_\.@]+$') -location = re.compile('^[0-9]{3}-[a-zA-Z][0-9]{3}$|none|bmr|cave|dsl|evl|mobile|offsite|mural|activespaces') macaddr = re.compile('^[0-9abcdef]{2}(:[0-9abcdef]{2}){5}$|virtual') ipaddr = re.compile('^[0-9]{1,3}(\.[0-9]{1,3}){3}$') -- cgit v1.2.3-1-g7c22