fog / fog-rackspace

Rackspace provider gem for Fog ecosystem
MIT License
8 stars 36 forks source link

How to apply a security group to a port #19

Open xsited opened 7 years ago

xsited commented 7 years ago

I have successfully created a security group with a hand full of rules. update_port() or port.save seems to only update port.name. Is there a different way to apply the security_group to a port?

xsited commented 7 years ago

After

--- update_port.rb.orig 2016-11-18 15:59:49.000000000 -0800
+++ update_port.rb  2016-11-18 16:00:05.000000000 -0800
@@ -3,7 +3,7 @@
     class NetworkingV2
       class Real
         def update_port(port)
-          data = {:port => {:name => port.name}}
+          data = {:port => {:name => port.name,:security_groups => port.security_groups}}

           request(
             :method  => 'PUT',

it seems to work.