{"action":"created","comment":{"url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/comments/37774973","id":37774973,"diff_hunk":"@@ -467,47 +469,187 @@ def update_policy_target_removed(self, context, policy_target):\n         if service_type != pconst.LOADBALANCER:\n             return\n \n-        self.update(context)\n+        self.update(context, pt_added_or_removed=True)\n \n     @log.log\n     def notify_chain_parameters_updated(self, context):\n         pass # We are not using the classifier specified in redirect Rule\n \n     @log.log\n+    def check_for_existing_service(self, context):\n+        if context._provider_group['provided_policy_rule_sets']:\n+            provided_policy_rule_set_id = context._provider_group[\n+                'provided_policy_rule_sets'][0]\n+        else:\n+            return True, None, True\n+        provided_policy_rule_set = context._gbp_plugin.get_policy_rule_set(\n+            context.plugin_context, provided_policy_rule_set_id)\n+        cons_policy_target_groups = provided_policy_rule_set[\n+            'consuming_policy_target_groups']\n+\n+        stack, sc_instances = self.get_firewall_stack_id(context,\n+                                             cons_policy_target_groups)\n+\n+        if context.consumer['id'] in cons_policy_target_groups:\n+            cons_policy_target_groups.remove(context.consumer['id'])\n+\n+        if stack:\n+            return True, cons_policy_target_groups, False\n+        else:\n+             return False, cons_policy_target_groups, False\n+        #\n+        # if cons_policy_target_groups:\n+        #     return True, cons_policy_target_groups, False\n+        # else:\n+        #     return False, cons_policy_target_groups, False\n+\n+    @log.log\n+    def append_firewall_rule(self, context, stack_template, provider_cidr,\n+                             consumer_cidr, fw_template_properties):\n+        resources_key = fw_template_properties['resources_key']\n+        properties_key = fw_template_properties['properties_key']\n+        fw_rule_keys = fw_template_properties['fw_rule_keys']\n+        rule_name = fw_template_properties['name']\n+        fw_policy_key = fw_template_properties['fw_policy_key']\n+        i = 1","path":"gbpservice/neutron/services/servicechain/plugins/ncp/node_drivers/oneconvergence_service_node_driver.py","position":72,"original_position":72,"commit_id":"f865a92eee21ef401da460e35a828ded4fe6ea18","original_commit_id":"f865a92eee21ef401da460e35a828ded4fe6ea18","user":{"login":"mageshgv-oc","id":10354859,"avatar_url":"https://avatars.githubusercontent.com/u/10354859?v=3","gravatar_id":"","url":"https://api.github.com/users/mageshgv-oc","html_url":"https://github.com/mageshgv-oc","followers_url":"https://api.github.com/users/mageshgv-oc/followers","following_url":"https://api.github.com/users/mageshgv-oc/following{/other_user}","gists_url":"https://api.github.com/users/mageshgv-oc/gists{/gist_id}","starred_url":"https://api.github.com/users/mageshgv-oc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mageshgv-oc/subscriptions","organizations_url":"https://api.github.com/users/mageshgv-oc/orgs","repos_url":"https://api.github.com/users/mageshgv-oc/repos","events_url":"https://api.github.com/users/mageshgv-oc/events{/privacy}","received_events_url":"https://api.github.com/users/mageshgv-oc/received_events","type":"User","site_admin":false},"body":"Wont the rules be overwritten for subsequent consumers since the value of i always starts from 1 ?","created_at":"2015-08-24T17:07:54Z","updated_at":"2015-08-24T17:07:54Z","html_url":"https://github.com/oneconvergence/group-based-policy/pull/32#discussion_r37774973","pull_request_url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/comments/37774973"},"html":{"href":"https://github.com/oneconvergence/group-based-policy/pull/32#discussion_r37774973"},"pull_request":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32","id":43125730,"html_url":"https://github.com/oneconvergence/group-based-policy/pull/32","diff_url":"https://github.com/oneconvergence/group-based-policy/pull/32.diff","patch_url":"https://github.com/oneconvergence/group-based-policy/pull/32.patch","issue_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/32","number":32,"state":"open","locked":false,"title":"Multiconcons fw","user":{"login":"Vikash082","id":4396870,"avatar_url":"https://avatars.githubusercontent.com/u/4396870?v=3","gravatar_id":"","url":"https://api.github.com/users/Vikash082","html_url":"https://github.com/Vikash082","followers_url":"https://api.github.com/users/Vikash082/followers","following_url":"https://api.github.com/users/Vikash082/following{/other_user}","gists_url":"https://api.github.com/users/Vikash082/gists{/gist_id}","starred_url":"https://api.github.com/users/Vikash082/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vikash082/subscriptions","organizations_url":"https://api.github.com/users/Vikash082/orgs","repos_url":"https://api.github.com/users/Vikash082/repos","events_url":"https://api.github.com/users/Vikash082/events{/privacy}","received_events_url":"https://api.github.com/users/Vikash082/received_events","type":"User","site_admin":false},"body":"Can be optimized further. Can be done during handling of N-S case.","created_at":"2015-08-23T18:19:29Z","updated_at":"2015-08-24T17:07:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20cde3a4ae32a687ff8ad012208ce041637ee2c8","assignee":{"login":"mageshgv-oc","id":10354859,"avatar_url":"https://avatars.githubusercontent.com/u/10354859?v=3","gravatar_id":"","url":"https://api.github.com/users/mageshgv-oc","html_url":"https://github.com/mageshgv-oc","followers_url":"https://api.github.com/users/mageshgv-oc/followers","following_url":"https://api.github.com/users/mageshgv-oc/following{/other_user}","gists_url":"https://api.github.com/users/mageshgv-oc/gists{/gist_id}","starred_url":"https://api.github.com/users/mageshgv-oc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mageshgv-oc/subscriptions","organizations_url":"https://api.github.com/users/mageshgv-oc/orgs","repos_url":"https://api.github.com/users/mageshgv-oc/repos","events_url":"https://api.github.com/users/mageshgv-oc/events{/privacy}","received_events_url":"https://api.github.com/users/mageshgv-oc/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32/commits","review_comments_url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32/comments","review_comment_url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/32/comments","statuses_url":"https://api.github.com/repos/oneconvergence/group-based-policy/statuses/f865a92eee21ef401da460e35a828ded4fe6ea18","head":{"label":"oneconvergence:multiconcons-fw","ref":"multiconcons-fw","sha":"f865a92eee21ef401da460e35a828ded4fe6ea18","user":{"login":"oneconvergence","id":8160602,"avatar_url":"https://avatars.githubusercontent.com/u/8160602?v=3","gravatar_id":"","url":"https://api.github.com/users/oneconvergence","html_url":"https://github.com/oneconvergence","followers_url":"https://api.github.com/users/oneconvergence/followers","following_url":"https://api.github.com/users/oneconvergence/following{/other_user}","gists_url":"https://api.github.com/users/oneconvergence/gists{/gist_id}","starred_url":"https://api.github.com/users/oneconvergence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneconvergence/subscriptions","organizations_url":"https://api.github.com/users/oneconvergence/orgs","repos_url":"https://api.github.com/users/oneconvergence/repos","events_url":"https://api.github.com/users/oneconvergence/events{/privacy}","received_events_url":"https://api.github.com/users/oneconvergence/received_events","type":"Organization","site_admin":false},"repo":{"id":34099604,"name":"group-based-policy","full_name":"oneconvergence/group-based-policy","owner":{"login":"oneconvergence","id":8160602,"avatar_url":"https://avatars.githubusercontent.com/u/8160602?v=3","gravatar_id":"","url":"https://api.github.com/users/oneconvergence","html_url":"https://github.com/oneconvergence","followers_url":"https://api.github.com/users/oneconvergence/followers","following_url":"https://api.github.com/users/oneconvergence/following{/other_user}","gists_url":"https://api.github.com/users/oneconvergence/gists{/gist_id}","starred_url":"https://api.github.com/users/oneconvergence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneconvergence/subscriptions","organizations_url":"https://api.github.com/users/oneconvergence/orgs","repos_url":"https://api.github.com/users/oneconvergence/repos","events_url":"https://api.github.com/users/oneconvergence/events{/privacy}","received_events_url":"https://api.github.com/users/oneconvergence/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oneconvergence/group-based-policy","description":"Group Based Policy","fork":true,"url":"https://api.github.com/repos/oneconvergence/group-based-policy","forks_url":"https://api.github.com/repos/oneconvergence/group-based-policy/forks","keys_url":"https://api.github.com/repos/oneconvergence/group-based-policy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oneconvergence/group-based-policy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oneconvergence/group-based-policy/teams","hooks_url":"https://api.github.com/repos/oneconvergence/group-based-policy/hooks","issue_events_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/events{/number}","events_url":"https://api.github.com/repos/oneconvergence/group-based-policy/events","assignees_url":"https://api.github.com/repos/oneconvergence/group-based-policy/assignees{/user}","branches_url":"https://api.github.com/repos/oneconvergence/group-based-policy/branches{/branch}","tags_url":"https://api.github.com/repos/oneconvergence/group-based-policy/tags","blobs_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/refs{/sha}","trees_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oneconvergence/group-based-policy/statuses/{sha}","languages_url":"https://api.github.com/repos/oneconvergence/group-based-policy/languages","stargazers_url":"https://api.github.com/repos/oneconvergence/group-based-policy/stargazers","contributors_url":"https://api.github.com/repos/oneconvergence/group-based-policy/contributors","subscribers_url":"https://api.github.com/repos/oneconvergence/group-based-policy/subscribers","subscription_url":"https://api.github.com/repos/oneconvergence/group-based-policy/subscription","commits_url":"https://api.github.com/repos/oneconvergence/group-based-policy/commits{/sha}","git_commits_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/commits{/sha}","comments_url":"https://api.github.com/repos/oneconvergence/group-based-policy/comments{/number}","issue_comment_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/comments{/number}","contents_url":"https://api.github.com/repos/oneconvergence/group-based-policy/contents/{+path}","compare_url":"https://api.github.com/repos/oneconvergence/group-based-policy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oneconvergence/group-based-policy/merges","archive_url":"https://api.github.com/repos/oneconvergence/group-based-policy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oneconvergence/group-based-policy/downloads","issues_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues{/number}","pulls_url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls{/number}","milestones_url":"https://api.github.com/repos/oneconvergence/group-based-policy/milestones{/number}","notifications_url":"https://api.github.com/repos/oneconvergence/group-based-policy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oneconvergence/group-based-policy/labels{/name}","releases_url":"https://api.github.com/repos/oneconvergence/group-based-policy/releases{/id}","created_at":"2015-04-17T06:06:34Z","updated_at":"2015-06-30T21:52:52Z","pushed_at":"2015-08-24T15:42:49Z","git_url":"git://github.com/oneconvergence/group-based-policy.git","ssh_url":"git@github.com:oneconvergence/group-based-policy.git","clone_url":"https://github.com/oneconvergence/group-based-policy.git","svn_url":"https://github.com/oneconvergence/group-based-policy","homepage":"http://openstack.org","size":2612,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":6,"forks":2,"open_issues":6,"watchers":0,"default_branch":"oneconvergence_service_node_driver"}},"base":{"label":"oneconvergence:oneconvergence_service_node_driver","ref":"oneconvergence_service_node_driver","sha":"edb9d236997682a09ff186cb6a3805ecf8ffc976","user":{"login":"oneconvergence","id":8160602,"avatar_url":"https://avatars.githubusercontent.com/u/8160602?v=3","gravatar_id":"","url":"https://api.github.com/users/oneconvergence","html_url":"https://github.com/oneconvergence","followers_url":"https://api.github.com/users/oneconvergence/followers","following_url":"https://api.github.com/users/oneconvergence/following{/other_user}","gists_url":"https://api.github.com/users/oneconvergence/gists{/gist_id}","starred_url":"https://api.github.com/users/oneconvergence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneconvergence/subscriptions","organizations_url":"https://api.github.com/users/oneconvergence/orgs","repos_url":"https://api.github.com/users/oneconvergence/repos","events_url":"https://api.github.com/users/oneconvergence/events{/privacy}","received_events_url":"https://api.github.com/users/oneconvergence/received_events","type":"Organization","site_admin":false},"repo":{"id":34099604,"name":"group-based-policy","full_name":"oneconvergence/group-based-policy","owner":{"login":"oneconvergence","id":8160602,"avatar_url":"https://avatars.githubusercontent.com/u/8160602?v=3","gravatar_id":"","url":"https://api.github.com/users/oneconvergence","html_url":"https://github.com/oneconvergence","followers_url":"https://api.github.com/users/oneconvergence/followers","following_url":"https://api.github.com/users/oneconvergence/following{/other_user}","gists_url":"https://api.github.com/users/oneconvergence/gists{/gist_id}","starred_url":"https://api.github.com/users/oneconvergence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneconvergence/subscriptions","organizations_url":"https://api.github.com/users/oneconvergence/orgs","repos_url":"https://api.github.com/users/oneconvergence/repos","events_url":"https://api.github.com/users/oneconvergence/events{/privacy}","received_events_url":"https://api.github.com/users/oneconvergence/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oneconvergence/group-based-policy","description":"Group Based Policy","fork":true,"url":"https://api.github.com/repos/oneconvergence/group-based-policy","forks_url":"https://api.github.com/repos/oneconvergence/group-based-policy/forks","keys_url":"https://api.github.com/repos/oneconvergence/group-based-policy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oneconvergence/group-based-policy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oneconvergence/group-based-policy/teams","hooks_url":"https://api.github.com/repos/oneconvergence/group-based-policy/hooks","issue_events_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/events{/number}","events_url":"https://api.github.com/repos/oneconvergence/group-based-policy/events","assignees_url":"https://api.github.com/repos/oneconvergence/group-based-policy/assignees{/user}","branches_url":"https://api.github.com/repos/oneconvergence/group-based-policy/branches{/branch}","tags_url":"https://api.github.com/repos/oneconvergence/group-based-policy/tags","blobs_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/refs{/sha}","trees_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oneconvergence/group-based-policy/statuses/{sha}","languages_url":"https://api.github.com/repos/oneconvergence/group-based-policy/languages","stargazers_url":"https://api.github.com/repos/oneconvergence/group-based-policy/stargazers","contributors_url":"https://api.github.com/repos/oneconvergence/group-based-policy/contributors","subscribers_url":"https://api.github.com/repos/oneconvergence/group-based-policy/subscribers","subscription_url":"https://api.github.com/repos/oneconvergence/group-based-policy/subscription","commits_url":"https://api.github.com/repos/oneconvergence/group-based-policy/commits{/sha}","git_commits_url":"https://api.github.com/repos/oneconvergence/group-based-policy/git/commits{/sha}","comments_url":"https://api.github.com/repos/oneconvergence/group-based-policy/comments{/number}","issue_comment_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/comments{/number}","contents_url":"https://api.github.com/repos/oneconvergence/group-based-policy/contents/{+path}","compare_url":"https://api.github.com/repos/oneconvergence/group-based-policy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oneconvergence/group-based-policy/merges","archive_url":"https://api.github.com/repos/oneconvergence/group-based-policy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oneconvergence/group-based-policy/downloads","issues_url":"https://api.github.com/repos/oneconvergence/group-based-policy/issues{/number}","pulls_url":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls{/number}","milestones_url":"https://api.github.com/repos/oneconvergence/group-based-policy/milestones{/number}","notifications_url":"https://api.github.com/repos/oneconvergence/group-based-policy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oneconvergence/group-based-policy/labels{/name}","releases_url":"https://api.github.com/repos/oneconvergence/group-based-policy/releases{/id}","created_at":"2015-04-17T06:06:34Z","updated_at":"2015-06-30T21:52:52Z","pushed_at":"2015-08-24T15:42:49Z","git_url":"git://github.com/oneconvergence/group-based-policy.git","ssh_url":"git@github.com:oneconvergence/group-based-policy.git","clone_url":"https://github.com/oneconvergence/group-based-policy.git","svn_url":"https://github.com/oneconvergence/group-based-policy","homepage":"http://openstack.org","size":2612,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":6,"forks":2,"open_issues":6,"watchers":0,"default_branch":"oneconvergence_service_node_driver"}},"_links":{"self":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32"},"html":{"href":"https://github.com/oneconvergence/group-based-policy/pull/32"},"issue":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/32"},"comments":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/oneconvergence/group-based-policy/statuses/f865a92eee21ef401da460e35a828ded4fe6ea18"}}}}