Fix a bug when restore a nova instance from UI.
First I backup a nova instance successfully, then I want to restore it, I have created an action and a job, but the job runned failed, I found an error in log of freezer agent: "The parameter --nova-restore-network is required" In the web form, the name of input field for network is called "nova_network_id", but in the freezer project, it's called "nova_restore_network". Change-Id: Ia2aba0090ac04c5d444fcab675d9cd3357db01cd Closes-Bug: #1686653
This commit is contained in:
parent
d0359ac2f6
commit
af953deb65
@ -101,7 +101,7 @@ class ActionConfigurationAction(workflows.Action):
|
|||||||
help_text=_("Id of nova instance for backup"),
|
help_text=_("Id of nova instance for backup"),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
nova_network_id = forms.CharField(
|
nova_restore_network = forms.CharField(
|
||||||
label=_("Nova network ID *"),
|
label=_("Nova network ID *"),
|
||||||
help_text=_("Id of nova network for recover"),
|
help_text=_("Id of nova network for recover"),
|
||||||
required=False)
|
required=False)
|
||||||
@ -184,14 +184,14 @@ class ActionConfigurationAction(workflows.Action):
|
|||||||
self._check_container(cleaned_data)
|
self._check_container(cleaned_data)
|
||||||
self._check_backup_name(cleaned_data)
|
self._check_backup_name(cleaned_data)
|
||||||
self._check_nova_inst_id(cleaned_data)
|
self._check_nova_inst_id(cleaned_data)
|
||||||
self._check_nova_network_id(cleaned_data)
|
self._check_nova_restore_network(cleaned_data)
|
||||||
|
|
||||||
return cleaned_data
|
return cleaned_data
|
||||||
|
|
||||||
def _check_nova_network_id(self, cleaned_data):
|
def _check_nova_restore_network(self, cleaned_data):
|
||||||
if not cleaned_data.get('nova_network_id'):
|
if not cleaned_data.get('nova_restore_network'):
|
||||||
msg = _("You must define nova network id to restore.")
|
msg = _("You must define nova network id to restore.")
|
||||||
self._errors['nova_network_id'] = self.error_class([msg])
|
self._errors['nova_restore_network'] = self.error_class([msg])
|
||||||
|
|
||||||
def _check_nova_inst_id(self, cleaned_data):
|
def _check_nova_inst_id(self, cleaned_data):
|
||||||
if not cleaned_data.get('nova_inst_id'):
|
if not cleaned_data.get('nova_inst_id'):
|
||||||
@ -275,7 +275,7 @@ class ActionConfiguration(workflows.Step):
|
|||||||
'restore_from_date',
|
'restore_from_date',
|
||||||
'cinder_vol_id',
|
'cinder_vol_id',
|
||||||
'nova_inst_id',
|
'nova_inst_id',
|
||||||
'nova_network_id',
|
'nova_restore_network',
|
||||||
'get_object',
|
'get_object',
|
||||||
'dst_file',
|
'dst_file',
|
||||||
'remove_older_than',
|
'remove_older_than',
|
||||||
|
@ -37,7 +37,7 @@ function hideEverything() {
|
|||||||
$("#id_restore_from_host").closest(".form-group").hide();
|
$("#id_restore_from_host").closest(".form-group").hide();
|
||||||
$("#id_restore_from_date").closest(".form-group").hide();
|
$("#id_restore_from_date").closest(".form-group").hide();
|
||||||
$("#restore-warning").hide();
|
$("#restore-warning").hide();
|
||||||
$("#id_nova_network_id").closest(".form-group").hide();
|
$("#id_nova_restore_network").closest(".form-group").hide();
|
||||||
|
|
||||||
// Admin specific controls
|
// Admin specific controls
|
||||||
$("#id_remove_older_than").closest(".form-group").hide();
|
$("#id_remove_older_than").closest(".form-group").hide();
|
||||||
@ -131,7 +131,7 @@ function setModeOptions() {
|
|||||||
$("#id_cinder_vol_id").closest(".form-group").show();
|
$("#id_cinder_vol_id").closest(".form-group").show();
|
||||||
} else if ($id_mode === 'nova') {
|
} else if ($id_mode === 'nova') {
|
||||||
$("#id_nova_inst_id").closest(".form-group").show();
|
$("#id_nova_inst_id").closest(".form-group").show();
|
||||||
$("#id_nova_network_id").closest(".form-group").show();
|
$("#id_nova_restore_network").closest(".form-group").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user