Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to apply a security group to a port #19

Open
xsited opened this issue Nov 18, 2016 · 1 comment
Open

How to apply a security group to a port #19

xsited opened this issue Nov 18, 2016 · 1 comment

Comments

@xsited
Copy link

xsited commented Nov 18, 2016

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
Copy link
Author

xsited commented Nov 19, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant