{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments/151770624","pull_request_review_id":77538356,"id":151770624,"diff_hunk":"@@ -66,6 +56,20 @@ int main(int argc, char **argv)\n         DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);\n         DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);\n \n+        /*\n+         * swss service starts after interfaces-config.service which will have\n+         * switch_mac set.\n+         * Dynamic switch_mac update is not supported for now.\n+         */\n+        Table table(&cfgDb, \"DEVICE_METADATA\", CONFIGDB_TABLE_NAME_SEPARATOR);\n+        std::vector<FieldValueTuple> ovalues;","path":"cfgmgr/vlanmgrd.cpp","position":36,"original_position":36,"commit_id":"d9be4d7ba7c0657600931593904b32cb481f74aa","original_commit_id":"d9be4d7ba7c0657600931593904b32cb481f74aa","user":{"login":"stcheng","id":2702699,"avatar_url":"https://avatars1.githubusercontent.com/u/2702699?v=4","gravatar_id":"","url":"https://api.github.com/users/stcheng","html_url":"https://github.com/stcheng","followers_url":"https://api.github.com/users/stcheng/followers","following_url":"https://api.github.com/users/stcheng/following{/other_user}","gists_url":"https://api.github.com/users/stcheng/gists{/gist_id}","starred_url":"https://api.github.com/users/stcheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stcheng/subscriptions","organizations_url":"https://api.github.com/users/stcheng/orgs","repos_url":"https://api.github.com/users/stcheng/repos","events_url":"https://api.github.com/users/stcheng/events{/privacy}","received_events_url":"https://api.github.com/users/stcheng/received_events","type":"User","site_admin":false},"body":" no need `std::`","created_at":"2017-11-17T19:30:22Z","updated_at":"2017-11-17T19:31:23Z","html_url":"https://github.com/Azure/sonic-swss/pull/392#discussion_r151770624","pull_request_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/392","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments/151770624"},"html":{"href":"https://github.com/Azure/sonic-swss/pull/392#discussion_r151770624"},"pull_request":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/392"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/sonic-swss/pulls/392","id":153233628,"html_url":"https://github.com/Azure/sonic-swss/pull/392","diff_url":"https://github.com/Azure/sonic-swss/pull/392.diff","patch_url":"https://github.com/Azure/sonic-swss/pull/392.patch","issue_url":"https://api.github.com/repos/Azure/sonic-swss/issues/392","number":392,"state":"open","locked":false,"title":"[cfgmgr] Use sonic-swss-common instead of exec redis-cli","user":{"login":"ishidawataru","id":5915117,"avatar_url":"https://avatars1.githubusercontent.com/u/5915117?v=4","gravatar_id":"","url":"https://api.github.com/users/ishidawataru","html_url":"https://github.com/ishidawataru","followers_url":"https://api.github.com/users/ishidawataru/followers","following_url":"https://api.github.com/users/ishidawataru/following{/other_user}","gists_url":"https://api.github.com/users/ishidawataru/gists{/gist_id}","starred_url":"https://api.github.com/users/ishidawataru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishidawataru/subscriptions","organizations_url":"https://api.github.com/users/ishidawataru/orgs","repos_url":"https://api.github.com/users/ishidawataru/repos","events_url":"https://api.github.com/users/ishidawataru/events{/privacy}","received_events_url":"https://api.github.com/users/ishidawataru/received_events","type":"User","site_admin":false},"body":"this enforces portablity of vlanmgrd\r\n\r\nSigned-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>\r\n\r\n<!--\r\nPlease make sure you have read and understood the contribution guildlines:\r\nhttps://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md\r\n\r\n1. Make sure your commit includes a signature generted with `git commit -s`\r\n2. Make sure your commit title follows the correct format: [component]: description\r\n3. Make sure your commit message contains enough details about the change and related tests\r\n4. Make sure your pull request adds related reviewers, asignees, labels\r\n\r\nPlease also provide the following information in this pull request:\r\n-->\r\n\r\n**What I did**\r\n\r\nUse `sonic-swss-common` instead of executing `redis-cli` to get MAC address of the device.\r\n\r\n**Why I did it**\r\n\r\nThis is kinda refactoring but I'm actually facing a problem with current implementation.\r\n\r\nI'm running `redis-server` in a diffrent docker container from a container which runs sonic's daemons.\r\nTwo containers shares a redis unix socket file and doesn't share a network namespace.\r\nIn this case, `vlanmgrd` crashes since current implementation executes `redis-cli` directly to get MAC address.\r\n\r\nSince we are passing `DBConnector::DEFAULT_UNIXSOCKET` to `DBConnector `, using `sonic-swss-common` can solve this issue.\r\nAlso, we can easily add an option to `vlanmgrd` for choosing how to connect to the redis server in the future.\r\n\r\n**How I verified it**\r\n\r\n**Details if related**\r\n","created_at":"2017-11-17T07:42:56Z","updated_at":"2017-11-17T19:31:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edbf8cc4cd5877cc73b1350c8f89c017fc5eab74","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/392/commits","review_comments_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/392/comments","review_comment_url":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/sonic-swss/issues/392/comments","statuses_url":"https://api.github.com/repos/Azure/sonic-swss/statuses/d9be4d7ba7c0657600931593904b32cb481f74aa","head":{"label":"ishidawataru:dev","ref":"dev","sha":"d9be4d7ba7c0657600931593904b32cb481f74aa","user":{"login":"ishidawataru","id":5915117,"avatar_url":"https://avatars1.githubusercontent.com/u/5915117?v=4","gravatar_id":"","url":"https://api.github.com/users/ishidawataru","html_url":"https://github.com/ishidawataru","followers_url":"https://api.github.com/users/ishidawataru/followers","following_url":"https://api.github.com/users/ishidawataru/following{/other_user}","gists_url":"https://api.github.com/users/ishidawataru/gists{/gist_id}","starred_url":"https://api.github.com/users/ishidawataru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishidawataru/subscriptions","organizations_url":"https://api.github.com/users/ishidawataru/orgs","repos_url":"https://api.github.com/users/ishidawataru/repos","events_url":"https://api.github.com/users/ishidawataru/events{/privacy}","received_events_url":"https://api.github.com/users/ishidawataru/received_events","type":"User","site_admin":false},"repo":{"id":110836028,"name":"sonic-swss","full_name":"ishidawataru/sonic-swss","owner":{"login":"ishidawataru","id":5915117,"avatar_url":"https://avatars1.githubusercontent.com/u/5915117?v=4","gravatar_id":"","url":"https://api.github.com/users/ishidawataru","html_url":"https://github.com/ishidawataru","followers_url":"https://api.github.com/users/ishidawataru/followers","following_url":"https://api.github.com/users/ishidawataru/following{/other_user}","gists_url":"https://api.github.com/users/ishidawataru/gists{/gist_id}","starred_url":"https://api.github.com/users/ishidawataru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishidawataru/subscriptions","organizations_url":"https://api.github.com/users/ishidawataru/orgs","repos_url":"https://api.github.com/users/ishidawataru/repos","events_url":"https://api.github.com/users/ishidawataru/events{/privacy}","received_events_url":"https://api.github.com/users/ishidawataru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ishidawataru/sonic-swss","description":"SONiC Switch State Service (SwSS)","fork":true,"url":"https://api.github.com/repos/ishidawataru/sonic-swss","forks_url":"https://api.github.com/repos/ishidawataru/sonic-swss/forks","keys_url":"https://api.github.com/repos/ishidawataru/sonic-swss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ishidawataru/sonic-swss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ishidawataru/sonic-swss/teams","hooks_url":"https://api.github.com/repos/ishidawataru/sonic-swss/hooks","issue_events_url":"https://api.github.com/repos/ishidawataru/sonic-swss/issues/events{/number}","events_url":"https://api.github.com/repos/ishidawataru/sonic-swss/events","assignees_url":"https://api.github.com/repos/ishidawataru/sonic-swss/assignees{/user}","branches_url":"https://api.github.com/repos/ishidawataru/sonic-swss/branches{/branch}","tags_url":"https://api.github.com/repos/ishidawataru/sonic-swss/tags","blobs_url":"https://api.github.com/repos/ishidawataru/sonic-swss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ishidawataru/sonic-swss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ishidawataru/sonic-swss/git/refs{/sha}","trees_url":"https://api.github.com/repos/ishidawataru/sonic-swss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ishidawataru/sonic-swss/statuses/{sha}","languages_url":"https://api.github.com/repos/ishidawataru/sonic-swss/languages","stargazers_url":"https://api.github.com/repos/ishidawataru/sonic-swss/stargazers","contributors_url":"https://api.github.com/repos/ishidawataru/sonic-swss/contributors","subscribers_url":"https://api.github.com/repos/ishidawataru/sonic-swss/subscribers","subscription_url":"https://api.github.com/repos/ishidawataru/sonic-swss/subscription","commits_url":"https://api.github.com/repos/ishidawataru/sonic-swss/commits{/sha}","git_commits_url":"https://api.github.com/repos/ishidawataru/sonic-swss/git/commits{/sha}","comments_url":"https://api.github.com/repos/ishidawataru/sonic-swss/comments{/number}","issue_comment_url":"https://api.github.com/repos/ishidawataru/sonic-swss/issues/comments{/number}","contents_url":"https://api.github.com/repos/ishidawataru/sonic-swss/contents/{+path}","compare_url":"https://api.github.com/repos/ishidawataru/sonic-swss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ishidawataru/sonic-swss/merges","archive_url":"https://api.github.com/repos/ishidawataru/sonic-swss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ishidawataru/sonic-swss/downloads","issues_url":"https://api.github.com/repos/ishidawataru/sonic-swss/issues{/number}","pulls_url":"https://api.github.com/repos/ishidawataru/sonic-swss/pulls{/number}","milestones_url":"https://api.github.com/repos/ishidawataru/sonic-swss/milestones{/number}","notifications_url":"https://api.github.com/repos/ishidawataru/sonic-swss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ishidawataru/sonic-swss/labels{/name}","releases_url":"https://api.github.com/repos/ishidawataru/sonic-swss/releases{/id}","deployments_url":"https://api.github.com/repos/ishidawataru/sonic-swss/deployments","created_at":"2017-11-15T13:21:06Z","updated_at":"2017-11-15T13:21:08Z","pushed_at":"2017-11-17T08:17:48Z","git_url":"git://github.com/ishidawataru/sonic-swss.git","ssh_url":"git@github.com:ishidawataru/sonic-swss.git","clone_url":"https://github.com/ishidawataru/sonic-swss.git","svn_url":"https://github.com/ishidawataru/sonic-swss","homepage":"https://azure.github.io/SONiC","size":1130,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"4cb542f1d933ea016bcf247a79d92684bb959284","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":53515475,"name":"sonic-swss","full_name":"Azure/sonic-swss","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/sonic-swss","description":"SONiC Switch State Service (SwSS)","fork":false,"url":"https://api.github.com/repos/Azure/sonic-swss","forks_url":"https://api.github.com/repos/Azure/sonic-swss/forks","keys_url":"https://api.github.com/repos/Azure/sonic-swss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/sonic-swss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/sonic-swss/teams","hooks_url":"https://api.github.com/repos/Azure/sonic-swss/hooks","issue_events_url":"https://api.github.com/repos/Azure/sonic-swss/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/sonic-swss/events","assignees_url":"https://api.github.com/repos/Azure/sonic-swss/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/sonic-swss/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/sonic-swss/tags","blobs_url":"https://api.github.com/repos/Azure/sonic-swss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/sonic-swss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/sonic-swss/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/sonic-swss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/sonic-swss/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/sonic-swss/languages","stargazers_url":"https://api.github.com/repos/Azure/sonic-swss/stargazers","contributors_url":"https://api.github.com/repos/Azure/sonic-swss/contributors","subscribers_url":"https://api.github.com/repos/Azure/sonic-swss/subscribers","subscription_url":"https://api.github.com/repos/Azure/sonic-swss/subscription","commits_url":"https://api.github.com/repos/Azure/sonic-swss/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/sonic-swss/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/sonic-swss/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/sonic-swss/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/sonic-swss/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/sonic-swss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/sonic-swss/merges","archive_url":"https://api.github.com/repos/Azure/sonic-swss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/sonic-swss/downloads","issues_url":"https://api.github.com/repos/Azure/sonic-swss/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/sonic-swss/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/sonic-swss/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/sonic-swss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/sonic-swss/labels{/name}","releases_url":"https://api.github.com/repos/Azure/sonic-swss/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/sonic-swss/deployments","created_at":"2016-03-09T17:01:09Z","updated_at":"2017-10-25T06:00:12Z","pushed_at":"2017-11-17T07:42:57Z","git_url":"git://github.com/Azure/sonic-swss.git","ssh_url":"git@github.com:Azure/sonic-swss.git","clone_url":"https://github.com/Azure/sonic-swss.git","svn_url":"https://github.com/Azure/sonic-swss","homepage":"https://azure.github.io/SONiC","size":1148,"stargazers_count":28,"watchers_count":28,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":38,"forks":40,"open_issues":38,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/392"},"html":{"href":"https://github.com/Azure/sonic-swss/pull/392"},"issue":{"href":"https://api.github.com/repos/Azure/sonic-swss/issues/392"},"comments":{"href":"https://api.github.com/repos/Azure/sonic-swss/issues/392/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/392/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/sonic-swss/pulls/392/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/sonic-swss/statuses/d9be4d7ba7c0657600931593904b32cb481f74aa"}},"author_association":"NONE"}}
{"actor":{"display_login":"stcheng"}}