From a11a789f3c44a58cf81e32a36b5928bf828d2db3 Mon Sep 17 00:00:00 2001 From: Ken Raffenetti Date: Tue, 24 Jun 2008 21:34:34 +0000 Subject: added in correction for hyphens in mac addresses added through hostbase git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4714 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Hostbase/hostbase/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib/Server/Hostbase/hostbase/views.py') diff --git a/src/lib/Server/Hostbase/hostbase/views.py b/src/lib/Server/Hostbase/hostbase/views.py index 33ab276de..e8a204417 100644 --- a/src/lib/Server/Hostbase/hostbase/views.py +++ b/src/lib/Server/Hostbase/hostbase/views.py @@ -216,7 +216,7 @@ def edit(request, host_id): ips = IP.objects.filter(interface=inter.id) if inter.mac_addr != request.POST['mac_addr%d' % inter.id]: text = do_log(text, 'mac_addr', inter.mac_addr, request.POST['mac_addr%d' % inter.id]) - inter.mac_addr = request.POST['mac_addr%d' % inter.id].lower() + inter.mac_addr = request.POST['mac_addr%d' % inter.id].lower().replace('-',':') if inter.hdwr_type != request.POST['hdwr_type%d' % inter.id]: oldtype = inter.hdwr_type text = do_log(text, 'hdwr_type', oldtype, request.POST['hdwr_type%d' % inter.id]) @@ -276,7 +276,7 @@ def edit(request, host_id): inter.save() if request.POST['mac_addr_new']: new_inter = Interface(host=host, - mac_addr=request.POST['mac_addr_new'].lower(), + mac_addr=request.POST['mac_addr_new'].lower().replace('-',':'), hdwr_type=request.POST['hdwr_type_new'], dhcp=request.POST['dhcp_new']) text = do_log(text, '*new*', 'mac_addr', new_inter.mac_addr) @@ -585,7 +585,7 @@ def new(request): if request.POST['mac_addr_new']: new_inter = Interface(host=host, - mac_addr=request.POST['mac_addr_new'].lower(), + mac_addr=request.POST['mac_addr_new'].lower().replace('-',':'), hdwr_type=request.POST['hdwr_type_new'], dhcp=request.POST.has_key('dhcp_new')) new_inter.save() @@ -643,7 +643,7 @@ def new(request): name.mxs.add(mx) if request.POST['mac_addr_new2']: new_inter = Interface(host=host, - mac_addr=request.POST['mac_addr_new2'].lower(), + mac_addr=request.POST['mac_addr_new2'].lower().replace('-',':'), hdwr_type=request.POST['hdwr_type_new2'], dhcp=request.POST.has_key('dhcp_new2')) new_inter.save() @@ -749,7 +749,7 @@ def copy(request, host_id): if request.POST['mac_addr_new']: new_inter = Interface(host=host, - mac_addr=request.POST['mac_addr_new'].lower(), + mac_addr=request.POST['mac_addr_new'].lower().replace('-',':'), hdwr_type=request.POST['hdwr_type_new'], dhcp=request.POST.has_key('dhcp_new')) new_inter.save() @@ -807,7 +807,7 @@ def copy(request, host_id): name.mxs.add(mx) if request.POST['mac_addr_new2']: new_inter = Interface(host=host, - mac_addr=request.POST['mac_addr_new2'].lower(), + mac_addr=request.POST['mac_addr_new2'].lower().replace('-',':'), hdwr_type=request.POST['hdwr_type_new2'], dhcp=request.POST.has_key('dhcp_new2')) new_inter.save() -- cgit v1.2.3-1-g7c22