Skip to content

Instantly share code, notes, and snippets.

@gnufied
Created October 27, 2011 17:22
Show Gist options
  • Save gnufied/1320193 to your computer and use it in GitHub Desktop.
Save gnufied/1320193 to your computer and use it in GitHub Desktop.
def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
requires :firewall_policy_id
options = {
:firewall_policy => firewall_policy_id,
:protocol => protocol,
:description => description,
:source => source,
:source_port => source_port,
:destination => destination,
:destination_port => destination_port,
:icmp_type_name => icmp_type_name
}.delete_if {|k,v| v.nil? || v == "" }
data = connection.create_firewall_rule(options)
merge_attributes(data)
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment