mirror of
https://github.com/retspen/webvirtcloud
synced 2024-11-01 03:54:15 +00:00
Fixed create net alias
This commit is contained in:
parent
1fcb49ffc8
commit
eda0a390fa
3 changed files with 4 additions and 4 deletions
|
@ -65,7 +65,7 @@ class AddInterface(forms.Form):
|
||||||
|
|
||||||
def clean_netdev(self):
|
def clean_netdev(self):
|
||||||
netdev = self.cleaned_data['netdev']
|
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:
|
if not have_symbol:
|
||||||
raise forms.ValidationError(_('The interface must not contain any special characters'))
|
raise forms.ValidationError(_('The interface must not contain any special characters'))
|
||||||
elif len(netdev) > 10:
|
elif len(netdev) > 10:
|
||||||
|
|
|
@ -16,7 +16,7 @@ class AddNetPool(forms.Form):
|
||||||
|
|
||||||
def clean_name(self):
|
def clean_name(self):
|
||||||
name = self.cleaned_data['name']
|
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:
|
if not have_symbol:
|
||||||
raise forms.ValidationError(_('The pool name must not contain any special characters'))
|
raise forms.ValidationError(_('The pool name must not contain any special characters'))
|
||||||
elif len(name) > 20:
|
elif len(name) > 20:
|
||||||
|
@ -35,7 +35,7 @@ class AddNetPool(forms.Form):
|
||||||
def clean_bridge_name(self):
|
def clean_bridge_name(self):
|
||||||
bridge_name = self.cleaned_data['bridge_name']
|
bridge_name = self.cleaned_data['bridge_name']
|
||||||
if self.cleaned_data['forward'] == 'bridge':
|
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:
|
if not have_symbol:
|
||||||
raise forms.ValidationError(_('The pool bridge name must not contain any special characters'))
|
raise forms.ValidationError(_('The pool bridge name must not contain any special characters'))
|
||||||
elif len(bridge_name) > 20:
|
elif len(bridge_name) > 20:
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<div class="form-group bridge_name_form_group">
|
<div class="form-group bridge_name_form_group">
|
||||||
<label class="col-sm-4 control-label">{% trans "Bridge Name" %}</label>
|
<label class="col-sm-4 control-label">{% trans "Bridge Name" %}</label>
|
||||||
<div class="col-sm-6">
|
<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>
|
</div>
|
||||||
<div class="form-group bridge_name_form_group">
|
<div class="form-group bridge_name_form_group">
|
||||||
|
|
Loading…
Reference in a new issue