{"action":"created","comment":{"url":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/comments/180800323","pull_request_review_id":111281692,"id":180800323,"diff_hunk":"@@ -141,6 +142,12 @@ def reconfigure_flannel_service():\n     remove_state('flannel.service.installed')\n \n \n+@when('etcd.available')\n+def etcd_changed(etcd):\n+    if data_changed('flannel_etcd_connections', etcd.get_connection_string()):","path":"reactive/flannel.py","position":14,"original_position":14,"commit_id":"47d416045bccf057d3116b123d1b030ec71c9b84","original_commit_id":"47d416045bccf057d3116b123d1b030ec71c9b84","user":{"login":"kwmonroe","id":4576822,"avatar_url":"https://avatars3.githubusercontent.com/u/4576822?v=4","gravatar_id":"","url":"https://api.github.com/users/kwmonroe","html_url":"https://github.com/kwmonroe","followers_url":"https://api.github.com/users/kwmonroe/followers","following_url":"https://api.github.com/users/kwmonroe/following{/other_user}","gists_url":"https://api.github.com/users/kwmonroe/gists{/gist_id}","starred_url":"https://api.github.com/users/kwmonroe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwmonroe/subscriptions","organizations_url":"https://api.github.com/users/kwmonroe/orgs","repos_url":"https://api.github.com/users/kwmonroe/repos","events_url":"https://api.github.com/users/kwmonroe/events{/privacy}","received_events_url":"https://api.github.com/users/kwmonroe/received_events","type":"User","site_admin":false},"body":"`data_changed` is hilarious in that the first time it runs, it will always be true.  So as written, we'll do the following on our first run through reactive:\r\n\r\n- render our template and set the `installed` flag in `install_flannel_service`\r\n- remove the `installed` flag in this `etcd_changed` handler because d_c is true\r\n-  jump back to `install_flannel_service`, re-rendering the template and re-setting the `installed` flag\r\n- fall into this `etcd_changed` handler again, which is a noop because d_c will be false this time\r\n\r\nTo prevent the double run of `install_flannel_service` and `etcd_changed`, you could prime the data_changed key in `install_flannel_service`. Something like:\r\n\r\n```python\r\n def install_flannel_service(etcd):\r\n     ''' Install the flannel service. '''\r\n     status_set('maintenance', 'Installing flannel service.')\r\n+    # keep track of our etcd conn string so we can detect when it changes later\r\n+    data_changed('flannel_etcd_connections', etcd.get_connection_string())\r\n     iface = config('iface') or get_bind_address_interface()\r\n```","created_at":"2018-04-11T15:36:12Z","updated_at":"2018-04-11T15:40:48Z","html_url":"https://github.com/juju-solutions/charm-flannel/pull/44#discussion_r180800323","pull_request_url":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/comments/180800323"},"html":{"href":"https://github.com/juju-solutions/charm-flannel/pull/44#discussion_r180800323"},"pull_request":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44","id":180938180,"html_url":"https://github.com/juju-solutions/charm-flannel/pull/44","diff_url":"https://github.com/juju-solutions/charm-flannel/pull/44.diff","patch_url":"https://github.com/juju-solutions/charm-flannel/pull/44.patch","issue_url":"https://api.github.com/repos/juju-solutions/charm-flannel/issues/44","number":44,"state":"open","locked":false,"title":"Fixing issue where flannel service wouldn't track etcd changes.","user":{"login":"hyperbolic2346","id":3506308,"avatar_url":"https://avatars1.githubusercontent.com/u/3506308?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperbolic2346","html_url":"https://github.com/hyperbolic2346","followers_url":"https://api.github.com/users/hyperbolic2346/followers","following_url":"https://api.github.com/users/hyperbolic2346/following{/other_user}","gists_url":"https://api.github.com/users/hyperbolic2346/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperbolic2346/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperbolic2346/subscriptions","organizations_url":"https://api.github.com/users/hyperbolic2346/orgs","repos_url":"https://api.github.com/users/hyperbolic2346/repos","events_url":"https://api.github.com/users/hyperbolic2346/events{/privacy}","received_events_url":"https://api.github.com/users/hyperbolic2346/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/544\r\n\r\nI didn't see any need to sort the array, no flapping in deployment.","created_at":"2018-04-11T15:14:40Z","updated_at":"2018-04-11T15:40:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fafeea7fb83303589a3f28e6f13389ec0cd9c68","assignee":null,"assignees":[],"requested_reviewers":[{"login":"wwwtyro","id":929443,"avatar_url":"https://avatars1.githubusercontent.com/u/929443?v=4","gravatar_id":"","url":"https://api.github.com/users/wwwtyro","html_url":"https://github.com/wwwtyro","followers_url":"https://api.github.com/users/wwwtyro/followers","following_url":"https://api.github.com/users/wwwtyro/following{/other_user}","gists_url":"https://api.github.com/users/wwwtyro/gists{/gist_id}","starred_url":"https://api.github.com/users/wwwtyro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwwtyro/subscriptions","organizations_url":"https://api.github.com/users/wwwtyro/orgs","repos_url":"https://api.github.com/users/wwwtyro/repos","events_url":"https://api.github.com/users/wwwtyro/events{/privacy}","received_events_url":"https://api.github.com/users/wwwtyro/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44/commits","review_comments_url":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44/comments","review_comment_url":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju-solutions/charm-flannel/issues/44/comments","statuses_url":"https://api.github.com/repos/juju-solutions/charm-flannel/statuses/47d416045bccf057d3116b123d1b030ec71c9b84","head":{"label":"hyperbolic2346:mwilson/flannel-etcd-updates","ref":"mwilson/flannel-etcd-updates","sha":"47d416045bccf057d3116b123d1b030ec71c9b84","user":{"login":"hyperbolic2346","id":3506308,"avatar_url":"https://avatars1.githubusercontent.com/u/3506308?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperbolic2346","html_url":"https://github.com/hyperbolic2346","followers_url":"https://api.github.com/users/hyperbolic2346/followers","following_url":"https://api.github.com/users/hyperbolic2346/following{/other_user}","gists_url":"https://api.github.com/users/hyperbolic2346/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperbolic2346/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperbolic2346/subscriptions","organizations_url":"https://api.github.com/users/hyperbolic2346/orgs","repos_url":"https://api.github.com/users/hyperbolic2346/repos","events_url":"https://api.github.com/users/hyperbolic2346/events{/privacy}","received_events_url":"https://api.github.com/users/hyperbolic2346/received_events","type":"User","site_admin":false},"repo":{"id":129027381,"name":"charm-flannel","full_name":"hyperbolic2346/charm-flannel","owner":{"login":"hyperbolic2346","id":3506308,"avatar_url":"https://avatars1.githubusercontent.com/u/3506308?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperbolic2346","html_url":"https://github.com/hyperbolic2346","followers_url":"https://api.github.com/users/hyperbolic2346/followers","following_url":"https://api.github.com/users/hyperbolic2346/following{/other_user}","gists_url":"https://api.github.com/users/hyperbolic2346/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperbolic2346/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperbolic2346/subscriptions","organizations_url":"https://api.github.com/users/hyperbolic2346/orgs","repos_url":"https://api.github.com/users/hyperbolic2346/repos","events_url":"https://api.github.com/users/hyperbolic2346/events{/privacy}","received_events_url":"https://api.github.com/users/hyperbolic2346/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hyperbolic2346/charm-flannel","description":"A fork of layer-flannel into a subordinate charm that implements the sdn-plugin interface","fork":true,"url":"https://api.github.com/repos/hyperbolic2346/charm-flannel","forks_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/forks","keys_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/teams","hooks_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/hooks","issue_events_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/issues/events{/number}","events_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/events","assignees_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/assignees{/user}","branches_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/branches{/branch}","tags_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/tags","blobs_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/languages","stargazers_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/stargazers","contributors_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/contributors","subscribers_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/subscribers","subscription_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/subscription","commits_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/contents/{+path}","compare_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/merges","archive_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/downloads","issues_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/issues{/number}","pulls_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/labels{/name}","releases_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/releases{/id}","deployments_url":"https://api.github.com/repos/hyperbolic2346/charm-flannel/deployments","created_at":"2018-04-11T03:12:55Z","updated_at":"2018-04-11T03:12:56Z","pushed_at":"2018-04-11T15:12:11Z","git_url":"git://github.com/hyperbolic2346/charm-flannel.git","ssh_url":"git@github.com:hyperbolic2346/charm-flannel.git","clone_url":"https://github.com/hyperbolic2346/charm-flannel.git","svn_url":"https://github.com/hyperbolic2346/charm-flannel","homepage":null,"size":74,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"juju-solutions:master","ref":"master","sha":"54b796be0f00cc98285d3587d040d41bc9f82c66","user":{"login":"juju-solutions","id":8684561,"avatar_url":"https://avatars1.githubusercontent.com/u/8684561?v=4","gravatar_id":"","url":"https://api.github.com/users/juju-solutions","html_url":"https://github.com/juju-solutions","followers_url":"https://api.github.com/users/juju-solutions/followers","following_url":"https://api.github.com/users/juju-solutions/following{/other_user}","gists_url":"https://api.github.com/users/juju-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/juju-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju-solutions/subscriptions","organizations_url":"https://api.github.com/users/juju-solutions/orgs","repos_url":"https://api.github.com/users/juju-solutions/repos","events_url":"https://api.github.com/users/juju-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/juju-solutions/received_events","type":"Organization","site_admin":false},"repo":{"id":67830732,"name":"charm-flannel","full_name":"juju-solutions/charm-flannel","owner":{"login":"juju-solutions","id":8684561,"avatar_url":"https://avatars1.githubusercontent.com/u/8684561?v=4","gravatar_id":"","url":"https://api.github.com/users/juju-solutions","html_url":"https://github.com/juju-solutions","followers_url":"https://api.github.com/users/juju-solutions/followers","following_url":"https://api.github.com/users/juju-solutions/following{/other_user}","gists_url":"https://api.github.com/users/juju-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/juju-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju-solutions/subscriptions","organizations_url":"https://api.github.com/users/juju-solutions/orgs","repos_url":"https://api.github.com/users/juju-solutions/repos","events_url":"https://api.github.com/users/juju-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/juju-solutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju-solutions/charm-flannel","description":"A fork of layer-flannel into a subordinate charm that implements the sdn-plugin interface","fork":false,"url":"https://api.github.com/repos/juju-solutions/charm-flannel","forks_url":"https://api.github.com/repos/juju-solutions/charm-flannel/forks","keys_url":"https://api.github.com/repos/juju-solutions/charm-flannel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju-solutions/charm-flannel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju-solutions/charm-flannel/teams","hooks_url":"https://api.github.com/repos/juju-solutions/charm-flannel/hooks","issue_events_url":"https://api.github.com/repos/juju-solutions/charm-flannel/issues/events{/number}","events_url":"https://api.github.com/repos/juju-solutions/charm-flannel/events","assignees_url":"https://api.github.com/repos/juju-solutions/charm-flannel/assignees{/user}","branches_url":"https://api.github.com/repos/juju-solutions/charm-flannel/branches{/branch}","tags_url":"https://api.github.com/repos/juju-solutions/charm-flannel/tags","blobs_url":"https://api.github.com/repos/juju-solutions/charm-flannel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju-solutions/charm-flannel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju-solutions/charm-flannel/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju-solutions/charm-flannel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju-solutions/charm-flannel/statuses/{sha}","languages_url":"https://api.github.com/repos/juju-solutions/charm-flannel/languages","stargazers_url":"https://api.github.com/repos/juju-solutions/charm-flannel/stargazers","contributors_url":"https://api.github.com/repos/juju-solutions/charm-flannel/contributors","subscribers_url":"https://api.github.com/repos/juju-solutions/charm-flannel/subscribers","subscription_url":"https://api.github.com/repos/juju-solutions/charm-flannel/subscription","commits_url":"https://api.github.com/repos/juju-solutions/charm-flannel/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju-solutions/charm-flannel/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju-solutions/charm-flannel/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju-solutions/charm-flannel/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju-solutions/charm-flannel/contents/{+path}","compare_url":"https://api.github.com/repos/juju-solutions/charm-flannel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju-solutions/charm-flannel/merges","archive_url":"https://api.github.com/repos/juju-solutions/charm-flannel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju-solutions/charm-flannel/downloads","issues_url":"https://api.github.com/repos/juju-solutions/charm-flannel/issues{/number}","pulls_url":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls{/number}","milestones_url":"https://api.github.com/repos/juju-solutions/charm-flannel/milestones{/number}","notifications_url":"https://api.github.com/repos/juju-solutions/charm-flannel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju-solutions/charm-flannel/labels{/name}","releases_url":"https://api.github.com/repos/juju-solutions/charm-flannel/releases{/id}","deployments_url":"https://api.github.com/repos/juju-solutions/charm-flannel/deployments","created_at":"2016-09-09T20:30:01Z","updated_at":"2017-01-09T15:38:35Z","pushed_at":"2018-04-11T15:14:41Z","git_url":"git://github.com/juju-solutions/charm-flannel.git","ssh_url":"git@github.com:juju-solutions/charm-flannel.git","clone_url":"https://github.com/juju-solutions/charm-flannel.git","svn_url":"https://github.com/juju-solutions/charm-flannel","homepage":null,"size":74,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":8,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44"},"html":{"href":"https://github.com/juju-solutions/charm-flannel/pull/44"},"issue":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/issues/44"},"comments":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/juju-solutions/charm-flannel/statuses/47d416045bccf057d3116b123d1b030ec71c9b84"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kwmonroe"}}