<div dir="ltr">More detail:<div>It's allowed to create duplicate sg with the same name.</div><div>so exception happens when creating instance with the duplicate sg name.</div><div>code following:</div><div> ....</div>
<div><div> security_groups = kwargs.get('security_groups', [])</div><div> security_group_ids = []</div><div><br></div><div> # TODO(arosen) Should optimize more to do direct query for security</div>
<div> # group if len(security_groups) == 1</div><div> if len(security_groups):</div><div> search_opts = {'tenant_id': instance['project_id']}</div><div> user_security_groups = neutron.list_security_groups(</div>
<div> **search_opts).get('security_groups')</div><div><br></div><div> for security_group in security_groups:</div><div> name_match = None</div><div> uuid_match = None</div>
<div> for user_security_group in user_security_groups:</div><div> if user_security_group['name'] == security_group:</div><div> if name_match:</div><div> raise exception.NoUniqueMatch(</div>
<div> _("Multiple security groups found matching"</div><div> " '%s'. Use an ID to be more specific.") %</div><div> security_group)</div>
<div><br></div><div> name_match = user_security_group['id']</div><div> ....</div><div><br></div><div>so it's maybe improper to create instance with the sg name parameter. any commend?</div>
<div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-07 16:25 GMT+08:00 ÀèÁÖ¹û <span dir="ltr"><<a href="mailto:lilinguo8212@gmail.com" target="_blank">lilinguo8212@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi stackers,<br><br><br></div>The duplicate name of sg may cause some problems, do you think so?<br>
<div><br><a href="https://bugs.launchpad.net/neutron/+bug/1289195" target="_blank">https://bugs.launchpad.net/neutron/+bug/1289195</a><br>
<br></div><div>Thanks!<br><br></div><div>Lee Li<br></div></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>