You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2011/07/27 13:09:38 UTC
Firewall create rule parameter consistency
Minor fix to restore consistency in firewall rule parameters. For a firewall rule the port range is specified with "port_from" and "port_to". However I found that the create rule operation was expecting the parameters "from_port" and "to_port" (made the documentation and operation potentially confusing),
marios
Re: [PATCH] Restore consistency in create firewall rule parameters... port range is specified with 'port_from' and 'port_to' (removes instances of 'from_port'/'to_port')
Posted by Michal Fojtik <mf...@redhat.com>.
On Jul 27, 2011, at 1:09 PM, marios@redhat.com wrote:
ACK.
-- Michal
> From: marios <ma...@redhat.com>
>
>
> Signed-off-by: marios <ma...@redhat.com>
> ---
> server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 2 +-
> server/server.rb | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index 4ca147b..67a4de4 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -657,7 +657,7 @@ module Deltacloud
> groups << {"group_name" => k, "owner" =>v}
> end
> safely do
> - ec2.manage_security_group_ingress(opts['id'], opts['from_port'], opts['to_port'], opts['protocol'],
> + ec2.manage_security_group_ingress(opts['id'], opts['port_from'], opts['port_to'], opts['protocol'],
> "authorize", opts['addresses'], groups)
> end
> end
> diff --git a/server/server.rb b/server/server.rb
> index 6b7271f..f1a03f0 100644
> --- a/server/server.rb
> +++ b/server/server.rb
> @@ -1084,8 +1084,8 @@ collection :firewalls do
> description 'Create a new firewall rule for the specified firewall'
> param :id, :required, :string, [], "Name of firewall in which to apply this rule"
> param :protocol, :required, :string, ['tcp','udp','icmp'], "Transport layer protocol for the rule"
> - param :from_port, :required, :string, [], "Start of port range for the rule"
> - param :to_port, :required, :string, [], "End of port range for the rule"
> + param :port_from, :required, :string, [], "Start of port range for the rule"
> + param :port_to, :required, :string, [], "End of port range for the rule"
> with_capability :create_firewall_rule
> control do
> #source IPs from params
> --
> 1.7.3.4
>
------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org
[PATCH] Restore consistency in create firewall rule parameters... port range is specified with 'port_from' and 'port_to' (removes instances of 'from_port'/'to_port')
Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>
Signed-off-by: marios <ma...@redhat.com>
---
server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 2 +-
server/server.rb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 4ca147b..67a4de4 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -657,7 +657,7 @@ module Deltacloud
groups << {"group_name" => k, "owner" =>v}
end
safely do
- ec2.manage_security_group_ingress(opts['id'], opts['from_port'], opts['to_port'], opts['protocol'],
+ ec2.manage_security_group_ingress(opts['id'], opts['port_from'], opts['port_to'], opts['protocol'],
"authorize", opts['addresses'], groups)
end
end
diff --git a/server/server.rb b/server/server.rb
index 6b7271f..f1a03f0 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -1084,8 +1084,8 @@ collection :firewalls do
description 'Create a new firewall rule for the specified firewall'
param :id, :required, :string, [], "Name of firewall in which to apply this rule"
param :protocol, :required, :string, ['tcp','udp','icmp'], "Transport layer protocol for the rule"
- param :from_port, :required, :string, [], "Start of port range for the rule"
- param :to_port, :required, :string, [], "End of port range for the rule"
+ param :port_from, :required, :string, [], "Start of port range for the rule"
+ param :port_to, :required, :string, [], "End of port range for the rule"
with_capability :create_firewall_rule
control do
#source IPs from params
--
1.7.3.4