)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":34581,"name":"Ian P. Christian","email":"pookey@pookey.co.uk"},"change_message_id":"a63d77046b9ec7d17ee243cd0e2e68d6a1593ddd","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"19781954_d4e21955","updated":"2022-02-22 08:46:41.000000000","message":"I have just hit issues with ansible openstack and have had to apply this patch to resolve this.\n\nWe his the issue in OVH\u0027s cloud, where I can apply SGs when creating a VM but they are silently ignored - because in OVH the internal network does not have SG\u0027s enabled (disabled by policy).\n\nWhen the openstack.cloud: module is called a second time (in subsequent runs) it will attempt to modify SGs (trying to add \u0027default\u0027 in) which fails due to the call that  adds SGs not failing silently like the create behaviour.\n\nThe only way to handle this is the allow for SG to be null by default.\n\nIn the instance of multi-homed server,  with this patch I can define SGs on the port: for external, and have no SGs on the port: for the internal.\n\n","commit_id":"b2f20669c509ff8494685f71c8158c13a1a5bf4e"}],"plugins/modules/server.py":[{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"82145d8590d0936ef1bdb1115beb3d2bfa6b94c8","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        - Names of the security groups to which the instance should be"},{"line_number":65,"context_line":"          added. This may be a YAML list or a comma separated string."},{"line_number":66,"context_line":"     type: list"},{"line_number":67,"context_line":"     default: None"},{"line_number":68,"context_line":"     elements: str"},{"line_number":69,"context_line":"   network:"},{"line_number":70,"context_line":"     description:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_de48c35d","line":67,"range":{"start_line":67,"start_character":5,"end_line":67,"end_character":18},"updated":"2020-06-10 12:59:00.000000000","message":"it\u0027s by default none, just need to delete default","commit_id":"731b85b9e021aa0be7b1c9fda6acea59b1ae2396"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"245e1979351bf1f04510acdbae9e0ecd0c71b5a2","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    ):"},{"line_number":596,"context_line":"        return changed, server"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"    module_security_groups \u003d set(module.params[\u0027security_groups\u0027])"},{"line_number":599,"context_line":"    server_security_groups \u003d set(sg[\u0027name\u0027] for sg in server.security_groups)"},{"line_number":600,"context_line":""},{"line_number":601,"context_line":"    add_sgs \u003d module_security_groups - server_security_groups"},{"line_number":602,"context_line":"    remove_sgs \u003d server_security_groups - module_security_groups"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff570b3c_e14e9cbf","line":599,"range":{"start_line":598,"start_character":0,"end_line":599,"end_character":77},"updated":"2020-06-12 18:53:40.000000000","message":"while \u0027default\u0027 now isn\u0027t in \u0027module_security_groups\u0027, it\u0027s still usually in \u0027server_security_groups\u0027, so need to remove it from comparison.\nsomething like:\n\nif \u0027default\u0027 in server_security_groups:\n    server_security_groups.remove(\u0027default\u0027)\n    if \u0027default\u0027 in module_security_groups:\n        module_security_groups.remove(\u0027default\u0027)","commit_id":"b2f20669c509ff8494685f71c8158c13a1a5bf4e"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"f0fba83baa7f4a2b3ca666ae111af3d8864892b2","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    ):"},{"line_number":596,"context_line":"        return changed, server"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"    module_security_groups \u003d set(module.params[\u0027security_groups\u0027])"},{"line_number":599,"context_line":"    server_security_groups \u003d set(sg[\u0027name\u0027] for sg in server.security_groups)"},{"line_number":600,"context_line":""},{"line_number":601,"context_line":"    add_sgs \u003d module_security_groups - server_security_groups"},{"line_number":602,"context_line":"    remove_sgs \u003d server_security_groups - module_security_groups"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_b847751d","line":599,"range":{"start_line":598,"start_character":0,"end_line":599,"end_character":77},"in_reply_to":"bf51134e_bdbca3dc","updated":"2020-07-10 12:54:05.000000000","message":"\u0027default\u0027 is usually added implicitly to security groups, for idempotency you need to exclude it when comparing with input parameters.\nWhen it\u0027s not added implicitly, you still can add it with input parameters. Removing it form comparison is done only when it presents in current security groups, see my example with nested \u0027if\u0027.","commit_id":"b2f20669c509ff8494685f71c8158c13a1a5bf4e"},{"author":{"_account_id":26299,"name":"Tatsuma Matsuki","email":"matsuki.tatsuma@jp.fujitsu.com","username":"tatsuma"},"change_message_id":"8fd182f6849c0d31bf63606567124bf22dd11264","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    ):"},{"line_number":596,"context_line":"        return changed, server"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"    module_security_groups \u003d set(module.params[\u0027security_groups\u0027])"},{"line_number":599,"context_line":"    server_security_groups \u003d set(sg[\u0027name\u0027] for sg in server.security_groups)"},{"line_number":600,"context_line":""},{"line_number":601,"context_line":"    add_sgs \u003d module_security_groups - server_security_groups"},{"line_number":602,"context_line":"    remove_sgs \u003d server_security_groups - module_security_groups"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_bdbca3dc","line":599,"range":{"start_line":598,"start_character":0,"end_line":599,"end_character":77},"in_reply_to":"ff570b3c_e14e9cbf","updated":"2020-07-08 23:40:51.000000000","message":"Why do you want to remove \"default\" SG from the comparison?\nSome users may want to add or remove \"default\" SG on existing servers.\n\nIs this for backward compatibility?","commit_id":"b2f20669c509ff8494685f71c8158c13a1a5bf4e"}]}
