Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving virtual machine host names can not exceed 14 characters #641

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions create/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class FlavorAddForm(forms.Form):
label = forms.CharField(label="Name",
error_messages={'required': _('No flavor name has been entered')},
max_length=20)
max_length=50)
vcpu = forms.IntegerField(label="VCPU",
error_messages={'required': _('No VCPU has been entered')}, )
disk = forms.IntegerField(label="HDD",
Expand All @@ -22,7 +22,7 @@ def clean_name(self):
have_symbol = re.match('^[a-zA-Z0-9._-]+$', label)
if not have_symbol:
raise forms.ValidationError(_('The flavor name must not contain any special characters'))
elif len(label) > 20:
elif len(label) > 50:
raise forms.ValidationError(_('The flavor name must not exceed 20 characters'))
try:
Flavor.objects.get(label=label)
Expand All @@ -33,7 +33,7 @@ def clean_name(self):

class NewVMForm(forms.Form):
name = forms.CharField(error_messages={'required': _('No Virtual Machine name has been entered')},
max_length=20)
max_length=50)
vcpu = forms.IntegerField(error_messages={'required': _('No VCPU has been entered')})
host_model = forms.BooleanField(required=False)
disk = forms.IntegerField(required=False)
Expand Down
2 changes: 1 addition & 1 deletion create/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class Flavor(models.Model):
label = models.CharField(max_length=12)
label = models.CharField(max_length=50)
memory = models.IntegerField()
vcpu = models.IntegerField()
disk = models.IntegerField()
Expand Down
2 changes: 1 addition & 1 deletion templates/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h4 class="modal-title">{% trans "Create Virtual Machine" %}

<div class="col-sm-6">
<input type="text" class="form-control" name="name"
placeholder="{% trans "Name" %}" maxlength="14" required
placeholder="{% trans "Name" %}" maxlength="50" required
pattern="[a-zA-Z0-9\.\-_]+">
<input type="hidden" name="vcpu" value="{{ flavor.vcpu }}">
<input type="hidden" name="memory" value="{{ flavor.memory }}">
Expand Down