cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [03/13] git commit: updated refs/heads/4.3 to 15ded4f
Date Mon, 24 Nov 2014 18:25:59 GMT
CLOUDSTACK-6647: appending instance name with custom supplied info that contains - character
can break vmsync.

(cherry picked from commit 98307bfcea54c0ea7633d28598c5ffc25927169a)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	api/src/com/cloud/vm/VirtualMachineName.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e4a3ee15
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e4a3ee15
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e4a3ee15

Branch: refs/heads/4.3
Commit: e4a3ee1526ebcbddfb5b85d555523e8fd86a1e1a
Parents: cef29cc
Author: Kelven Yang <kelveny@gmail.com>
Authored: Thu May 1 15:40:04 2014 -0700
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Nov 24 21:13:13 2014 +0530

----------------------------------------------------------------------
 api/src/com/cloud/vm/VirtualMachineName.java | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e4a3ee15/api/src/com/cloud/vm/VirtualMachineName.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VirtualMachineName.java b/api/src/com/cloud/vm/VirtualMachineName.java
index 49cb40b..2ae91e8 100755
--- a/api/src/com/cloud/vm/VirtualMachineName.java
+++ b/api/src/com/cloud/vm/VirtualMachineName.java
@@ -18,8 +18,6 @@ package com.cloud.vm;
 
 import java.util.Formatter;
 
-import com.cloud.dc.Vlan;
-
 /**
  * VM Name. 
  */
@@ -52,26 +50,16 @@ public class VirtualMachineName {
     
     public static boolean isValidVmName(String vmName, String instance) {
         String[] tokens = vmName.split(SEPARATOR);
-        /*Some vms doesn't have vlan/vnet id*/
-        if (tokens.length != 5 && tokens.length != 4) {
+
+        if (tokens.length <= 1) {
             return false;
         }
 
         if (!tokens[0].equals("i")) {
             return false;
         }
-        
-        try {
-            Long.parseLong(tokens[1]);
-            Long.parseLong(tokens[2]);
-            if (tokens.length == 5 && !Vlan.UNTAGGED.equalsIgnoreCase(tokens[4]))
{
-            	Long.parseLong(tokens[4], 16);
-            }
-        } catch (NumberFormatException e) {
-            return false;
-        }
-        
-        return instance == null || instance.equals(tokens[3]);
+
+        return true;
     }
     
     public static String getVmName(long vmId, long userId, String instance) {


Mime
View raw message