1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

Fixed create net alias

This commit is contained in:
Retspen 2015-04-21 15:58:56 +03:00
parent 1fcb49ffc8
commit eda0a390fa
3 changed files with 4 additions and 4 deletions

View file

@ -65,7 +65,7 @@ class AddInterface(forms.Form):
def clean_netdev(self):
netdev = self.cleaned_data['netdev']
have_symbol = re.match('^[a-z0-9.]+$', netdev)
have_symbol = re.match('^[a-z0-9.:]+$', netdev)
if not have_symbol:
raise forms.ValidationError(_('The interface must not contain any special characters'))
elif len(netdev) > 10:

View file

@ -16,7 +16,7 @@ class AddNetPool(forms.Form):
def clean_name(self):
name = self.cleaned_data['name']
have_symbol = re.match('^[a-zA-Z0-9._-]+$', name)
have_symbol = re.match('^[a-zA-Z0-9\.\_\-]+$', name)
if not have_symbol:
raise forms.ValidationError(_('The pool name must not contain any special characters'))
elif len(name) > 20:
@ -35,7 +35,7 @@ class AddNetPool(forms.Form):
def clean_bridge_name(self):
bridge_name = self.cleaned_data['bridge_name']
if self.cleaned_data['forward'] == 'bridge':
have_symbol = re.match('^[a-zA-Z0-9._-]+$', bridge_name)
have_symbol = re.match('^[a-zA-Z0-9\.\_\:\-]+$', bridge_name)
if not have_symbol:
raise forms.ValidationError(_('The pool bridge name must not contain any special characters'))
elif len(bridge_name) > 20:

View file

@ -52,7 +52,7 @@
<div class="form-group bridge_name_form_group">
<label class="col-sm-4 control-label">{% trans "Bridge Name" %}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="bridge_name" placeholder="br0" pattern="[a-z0-9\-_]+">
<input type="text" class="form-control" name="bridge_name" placeholder="br0" pattern="[a-z0-9\-_:]+">
</div>
</div>
<div class="form-group bridge_name_form_group">