summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Hostbase
diff options
context:
space:
mode:
authorKen Raffenetti <raffenet@mcs.anl.gov>2008-06-24 21:34:34 +0000
committerKen Raffenetti <raffenet@mcs.anl.gov>2008-06-24 21:34:34 +0000
commita11a789f3c44a58cf81e32a36b5928bf828d2db3 (patch)
tree6f8cde9ad27c65192879fc1d25a16e23c59aae44 /src/lib/Server/Hostbase
parentb02943b7b9d6774f9b392d779917e39a1db34124 (diff)
downloadbcfg2-a11a789f3c44a58cf81e32a36b5928bf828d2db3.tar.gz
bcfg2-a11a789f3c44a58cf81e32a36b5928bf828d2db3.tar.bz2
bcfg2-a11a789f3c44a58cf81e32a36b5928bf828d2db3.zip
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
Diffstat (limited to 'src/lib/Server/Hostbase')
-rw-r--r--src/lib/Server/Hostbase/hostbase/views.py12
1 files changed, 6 insertions, 6 deletions
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()