mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
Merge pull request #1333 from nitin-maharana/CloudStack-Nitin16_4.7
CLOUDSTACK-9228: Network update with mistmatch in services require forced option# Steps to reproduce: 1.Bring up CloudStack in advanced zone 2.Create isolated network with sourcenat, pf, lb, firewall services 3.Deploy a VM in the above network 4.Create another network offering with sourcenat, pf, firewall services 5.Try to update the network with offering created in step4 # Result: The new offering:DefaultIsolatedNetworkOfferingForVpcNetworksNoLB will remove the following services [Lb]along with all the related configuration currently in use. will not proceed with the network update.set forced parameter to true for forcing an update." # Workaround: Use api with forced=true # Fix: Added a confirmation dialog box to check whether to make force update or not. The dialog appears only for the Admin. Only admin can make force update. The new dialog appears after the first CIDR unchanged confirmation dialog. * pr/1333: CLOUDSTACK-9228: Network update with mistmatch in services require forced option Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
This commit is contained in:
commit
74036d01c0
@ -1965,6 +1965,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
|
||||
"message.confirm.enable.provider":"Please confirm that you would like to enable this provider",
|
||||
"message.confirm.enable.vnmc.provider":"Please confirm you would like to enable the VNMC provider.",
|
||||
"message.confirm.enable.vpc.offering":"Are you sure you want to enable this VPC offering?",
|
||||
"message.confirm.force.update":"Do you want to make a force update?",
|
||||
"message.confirm.join.project":"Please confirm you wish to join this project.",
|
||||
"message.confirm.migrate.volume":"Do you want to migrate this volume?",
|
||||
"message.confirm.refresh.blades":"Please confirm that you want to refresh blades.",
|
||||
|
||||
@ -965,53 +965,15 @@
|
||||
if (args.context.networks[0].type == "Isolated") { //Isolated network
|
||||
cloudStack.dialog.confirm({
|
||||
message: 'message.confirm.current.guest.CIDR.unchanged',
|
||||
action: function() { //"Yes" button is clicked
|
||||
$.extend(data, {
|
||||
changecidr: false
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {
|
||||
data: item
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
action: function() { //"Yes" button is clicked
|
||||
getForcedInfoAndUpdateNetwork(data);
|
||||
},
|
||||
cancelAction: function() { //"Cancel" button is clicked
|
||||
$.extend(data, {
|
||||
changecidr: true
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {
|
||||
data: item
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
getForcedInfoAndUpdateNetwork(data);
|
||||
}
|
||||
});
|
||||
return;
|
||||
@ -6496,4 +6458,79 @@
|
||||
return data;
|
||||
}
|
||||
|
||||
function getForcedInfoAndUpdateNetwork(data) {
|
||||
if (isAdmin()) {
|
||||
cloudStack.dialog.confirm({
|
||||
message: "message.confirm.force.update",
|
||||
action: function() {
|
||||
$.extend(data, {
|
||||
forced: true
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
async: false,
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {
|
||||
data: item
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelAction: function() {
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
async: false,
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {
|
||||
data: item
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.ajax({
|
||||
url: createURL('updateNetwork'),
|
||||
async: false,
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.network;
|
||||
return {
|
||||
data: item
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
})(cloudStack, jQuery);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user