You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Francesco Vollero <fv...@redhat.com> on 2011/09/13 16:07:28 UTC
[PATCH core] Fixed RegEx that wasn't recognize correctly the ipv4
Signed-off-by: Francesco Vollero <fv...@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
Re: [PATCH core] Fixed RegEx that wasn't recognize correctly the ipv4
Posted by Michal Fojtik <mf...@redhat.com>.
On Sep 13, 2011, at 4:07 PM, Francesco Vollero wrote:
ACK.
We should probably stick there a NOTE to completely rework this piece in way
where we will not do 'guessing' ;-)
-- Michal
>
> Signed-off-by: Francesco Vollero <fv...@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
>
------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org