deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Vollero <fvoll...@redhat.com>
Subject [PATCH core] Fixed RegEx that wasn't recognize correctly the ipv4
Date Tue, 13 Sep 2011 14:07:28 GMT

Signed-off-by: Francesco Vollero <fvollero@redhat.com>
---
 .../lib/deltacloud/helpers/application_helper.rb   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/helpers/application_helper.rb b/server/lib/deltacloud/helpers/application_helper.rb
index 03a5770..6a38a9c 100644
--- a/server/lib/deltacloud/helpers/application_helper.rb
+++ b/server/lib/deltacloud/helpers/application_helper.rb
@@ -258,7 +258,7 @@ module ApplicationHelper
   def address_type(address)
     case address
       when /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?$/; :ipv4
-      when /^.*:([\-\d]+)$/; :vnc
+      when /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:[\-\d]+)$/; :vnc
       when /^(\S{1,2}:\S{1,2}:\S{1,2}:\S{1,2}:\S{1,2}:\S{1,2})?$/; :mac
       else :hostname
     end
-- 
1.7.4.4


Mime
View raw message