mirror of https://github.com/apache/cloudstack.git
Fix Bug CloudStack-9 can not change OS preference from OS to none
This commit is contained in:
parent
8a2259d2af
commit
dd07d1598f
|
|
@ -17,6 +17,8 @@
|
|||
package com.cloud.storage;
|
||||
|
||||
public interface GuestOsCategory {
|
||||
// Used by OS preference, 'None' for no OS preference
|
||||
public static final String CATEGORY_NONE ="None";
|
||||
long getId();
|
||||
|
||||
String getName();
|
||||
|
|
|
|||
|
|
@ -1211,7 +1211,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
|
|||
GuestOSCategoryVO guestOSCategory = _guestOSCategoryDao.findById(guestOSCategoryId);
|
||||
Map<String, String> hostDetails = _hostDetailsDao.findDetails(hostId);
|
||||
|
||||
if (guestOSCategory != null) {
|
||||
if (guestOSCategory != null && !GuestOSCategoryVO.CATEGORY_NONE.equalsIgnoreCase(guestOSCategory.getName())) {
|
||||
// Save a new entry for guest.os.category.id
|
||||
hostDetails.put("guest.os.category.id", String.valueOf(guestOSCategory.getId()));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -466,3 +466,5 @@ UPDATE `cloud`.`configuration` SET description='Comma separated list of cidrs in
|
|||
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.vpngateway.connection.limit', '4', 'The maximum number of VPN connection per VPN gateway');
|
||||
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.customergateway.subnets.limit', '10', 'The maximum number of subnets per customer gateway');
|
||||
|
||||
INSERT IGNORE INTO `cloud`.`guest_os_category` VALUES ('11','None',NULL);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (7, 'Other');
|
|||
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (8, 'Novel');
|
||||
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (9, 'Unix');
|
||||
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (10, 'Ubuntu');
|
||||
|
||||
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (11, 'None');
|
||||
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (1, 1, 'CentOS 4.5 (32-bit)');
|
||||
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (2, 1, 'CentOS 4.6 (32-bit)');
|
||||
|
|
|
|||
|
|
@ -7635,7 +7635,7 @@
|
|||
var array1 = [];
|
||||
array1.push("&hosttags=" + todb(args.data.hosttags));
|
||||
|
||||
if (args.data.oscategoryid != null && args.data.oscategoryid != 'None')
|
||||
if (args.data.oscategoryid != null)
|
||||
array1.push("&osCategoryId=" + args.data.oscategoryid);
|
||||
|
||||
$.ajax({
|
||||
|
|
@ -7852,11 +7852,12 @@
|
|||
async: true,
|
||||
success: function(json) {
|
||||
var oscategoryObjs = json.listoscategoriesresponse.oscategory;
|
||||
var items = [
|
||||
{ id: null, description: _l('label.none') }
|
||||
];
|
||||
var items = [];
|
||||
$(oscategoryObjs).each(function() {
|
||||
items.push({id: this.id, description: this.name});
|
||||
if(this.name == 'None')
|
||||
items.unshift({ id: this.id, description: _l('label.none') });
|
||||
else
|
||||
items.push({id: this.id, description: this.name});
|
||||
});
|
||||
args.response.success({data: items});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue