mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	bug 6362: Need to call guestos.getDisplayName to the guest os name now.
status 6362: resolved fixed
This commit is contained in:
		
							parent
							
								
									9e0fa5abd3
								
							
						
					
					
						commit
						26807bc701
					
				| @ -21,11 +21,14 @@ package com.cloud.hypervisor.xen.resource; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| 
 | ||||
| import org.apache.log4j.Logger; | ||||
| 
 | ||||
| /** | ||||
|  * Reduce bloat inside CitrixResourceBase | ||||
|  * | ||||
|  */ | ||||
| public class CitrixHelper { | ||||
| 	 private static final Logger s_logger = Logger.getLogger(CitrixHelper.class); | ||||
| 	private static final HashMap<String, String> _guestOsMap = new HashMap<String, String>(70); | ||||
| 	private static final ArrayList<String> _guestOsList = new ArrayList<String>(70); | ||||
| 
 | ||||
| @ -45,7 +48,7 @@ public class CitrixHelper { | ||||
|         _guestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5.3 x64"); | ||||
|         _guestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5.4"); | ||||
|         _guestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5.4 x64"); | ||||
|         _guestOsMap.put("Debian Lenny 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)"); | ||||
|         _guestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5.0"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5.0 x64"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5.1"); | ||||
| @ -93,6 +96,11 @@ public class CitrixHelper { | ||||
|     } | ||||
|      | ||||
|     public static String getGuestOsType(String stdType) { | ||||
|         return _guestOsMap.get(stdType); | ||||
|         String guestOS =  _guestOsMap.get(stdType); | ||||
|         if (guestOS == null) { | ||||
|         	s_logger.debug("Can't find the guest os: " + stdType + " mapping into xenserver's guestOS type, start it as HVM guest"); | ||||
|         	guestOS = "Other install media"; | ||||
|         } | ||||
|         return guestOS; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -186,7 +186,7 @@ public class RegisterIsoCmd extends BaseCmd { | ||||
|         		listForEmbeddedObject.add(new Pair<String, Object>(BaseCmd.Properties.IS_FEATURED.getName(), Boolean.valueOf(template.isFeatured()).toString())); | ||||
|         		listForEmbeddedObject.add(new Pair<String, Object>(BaseCmd.Properties.BOOTABLE.getName(), Boolean.valueOf(template.isBootable()).toString())); | ||||
|         		listForEmbeddedObject.add(new Pair<String, Object>(BaseCmd.Properties.OS_TYPE_ID.getName(), template.getGuestOSId())); | ||||
|         		listForEmbeddedObject.add(new Pair<String, Object>(BaseCmd.Properties.OS_TYPE_NAME.getName(), getManagementServer().findGuestOSById(template.getGuestOSId()).getName())); | ||||
|         		listForEmbeddedObject.add(new Pair<String, Object>(BaseCmd.Properties.OS_TYPE_NAME.getName(), getManagementServer().findGuestOSById(template.getGuestOSId()).getDisplayName())); | ||||
|         				 | ||||
|         		Account owner = getManagementServer().findAccountById(template.getAccountId()); | ||||
|         		if (owner != null) { | ||||
|  | ||||
| @ -58,7 +58,7 @@ public class CopyTemplateExecutor extends BaseAsyncJobExecutor { | ||||
| 				long guestOsId = template.getGuestOSId(); | ||||
| 		        Account owner = managementServer.findAccountById(template.getAccountId()); | ||||
| 		        Domain domain = managementServer.findDomainIdById(owner.getDomainId()); | ||||
| 		        String guestOSName = managementServer.findGuestOSById(guestOsId).getName(); | ||||
| 		        String guestOSName = managementServer.findGuestOSById(guestOsId).getDisplayName(); | ||||
| 				asyncMgr.completeAsyncJob(getJob().getId(), AsyncJobResult.STATUS_SUCCEEDED, 0, composeResultObject(template, templateHostRef, destZone,guestOSName, owner, domain)); | ||||
| 			} else { | ||||
| 				asyncMgr.completeAsyncJob(getJob().getId(), AsyncJobResult.STATUS_FAILED, BaseCmd.INTERNAL_ERROR, "Failed to copy template."); | ||||
|  | ||||
| @ -654,7 +654,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, VirtualMach | ||||
|                         s_logger.debug(msg);  | ||||
|                         throw new CloudRuntimeException(msg); | ||||
|                     } else { | ||||
|                         guestOSDescription = guestOS.getName(); | ||||
|                         guestOSDescription = guestOS.getDisplayName(); | ||||
|                     } | ||||
|                     // _storageMgr.share(proxy, vols, null, true); | ||||
| 
 | ||||
|  | ||||
| @ -997,7 +997,7 @@ public class NetworkManagerImpl implements NetworkManager, VirtualMachineManager | ||||
| 	                        s_logger.debug(msg);  | ||||
| 	                        throw new CloudRuntimeException(msg); | ||||
| 	                    } else { | ||||
| 	                        guestOSDescription = guestOS.getName(); | ||||
| 	                        guestOSDescription = guestOS.getDisplayName(); | ||||
| 	                    } | ||||
| 	                     | ||||
| 	                    final StartRouterCommand cmdStartRouter = new StartRouterCommand(router, _networkRate, | ||||
|  | ||||
| @ -385,7 +385,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V | ||||
| 		                s_logger.debug(msg);  | ||||
| 		                throw new CloudRuntimeException(msg); | ||||
| 		            } else { | ||||
| 		                guestOSDescription = guestOS.getName(); | ||||
| 		                guestOSDescription = guestOS.getDisplayName(); | ||||
| 		            } | ||||
| 		             | ||||
| 					// carry the secondary storage vm port info over so that we don't | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user