{"action":"created","comment":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/56287598","id":56287598,"diff_hunk":"@@ -140,8 +106,68 @@ fi\n \n #Restart docker service\n service docker restart\n+# It is found that sometimes the docker ps will failed if run immediately after restart docker daemon\n+sleep 2\n docker ps\n if [ $? -ne 0 ]; then\n     echo \"Docker service starting failed\"\n     exit 1\n fi\n+\n+# TO check whether the docker server version is lower than or equal to 1.10\n+#    If so, need to create docker network object based on the bridge specified\n+#    Else, use the brdige as an option for docker daemon\n+\n+\n+# For docker 1.8.x and higher\n+DOCKER_VERSION=`docker info 2>/dev/null | grep \"Server Version:\" | awk -F: '{print $2}'`\n+if [ -z \"$DOCKER_VERSION\" ];then\n+    # For docker 1.7.x and lower\n+    DOCKER_VERSION=`docker version | grep \"Server version\" | awk -F: '{print $2}'`\n+    if [ -z \"$DOCKER_VERSION\" ];then\n+        echo \"Failed to get docker server version\"\n+        exit 1\n+    fi\n+fi\n+MAX_VERSION=`echo $DOCKER_VERSION | awk -F. '{print $1}'`\n+MIN_VERSION=`echo $DOCKER_VERSION | awk -F. '{print $2}'`\n+if [ -z \"$MAX_VERSION\" -o -z \"$MIN_VERSION\" ]; then\n+    echo \"The docker version $DOCKER_VERSION can not be recorgnized\"\n+    exit 1\n+fi\n+\n+FLAG=0\n+if [  $MAX_VERSION -le 1 -a $MIN_VERSION -le 10 ]; then\n+    FLAG=1\n+fi\n+\n+# The docker newer than 1.10.x can accept NICNAME directly.\n+# But we treat it as 1.10.x in case it is not supported immediately.\n+FLAG=1","path":"xCAT/postscripts/setupdockerhost","position":142,"original_position":142,"commit_id":"f992b9d0bf5ce47582b119ccbd0968121274ae6b","original_commit_id":"f992b9d0bf5ce47582b119ccbd0968121274ae6b","user":{"login":"daniceexi","id":10385985,"avatar_url":"https://avatars.githubusercontent.com/u/10385985?v=3","gravatar_id":"","url":"https://api.github.com/users/daniceexi","html_url":"https://github.com/daniceexi","followers_url":"https://api.github.com/users/daniceexi/followers","following_url":"https://api.github.com/users/daniceexi/following{/other_user}","gists_url":"https://api.github.com/users/daniceexi/gists{/gist_id}","starred_url":"https://api.github.com/users/daniceexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniceexi/subscriptions","organizations_url":"https://api.github.com/users/daniceexi/orgs","repos_url":"https://api.github.com/users/daniceexi/repos","events_url":"https://api.github.com/users/daniceexi/events{/privacy}","received_events_url":"https://api.github.com/users/daniceexi/received_events","type":"User","site_admin":false},"body":"why did you set it in static here?","created_at":"2016-03-16T06:45:25Z","updated_at":"2016-03-16T06:45:25Z","html_url":"https://github.com/xcat2/xcat-core/pull/794#discussion_r56287598","pull_request_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/794","_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/56287598"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/794#discussion_r56287598"},"pull_request":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/794"}}},"pull_request":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/794","id":62522745,"html_url":"https://github.com/xcat2/xcat-core/pull/794","diff_url":"https://github.com/xcat2/xcat-core/pull/794.diff","patch_url":"https://github.com/xcat2/xcat-core/pull/794.patch","issue_url":"https://api.github.com/repos/xcat2/xcat-core/issues/794","number":794,"state":"open","locked":false,"title":"modify setupdockerhost to create network object based on the bridge s…","user":{"login":"zet809","id":8222144,"avatar_url":"https://avatars.githubusercontent.com/u/8222144?v=3","gravatar_id":"","url":"https://api.github.com/users/zet809","html_url":"https://github.com/zet809","followers_url":"https://api.github.com/users/zet809/followers","following_url":"https://api.github.com/users/zet809/following{/other_user}","gists_url":"https://api.github.com/users/zet809/gists{/gist_id}","starred_url":"https://api.github.com/users/zet809/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zet809/subscriptions","organizations_url":"https://api.github.com/users/zet809/orgs","repos_url":"https://api.github.com/users/zet809/repos","events_url":"https://api.github.com/users/zet809/events{/privacy}","received_events_url":"https://api.github.com/users/zet809/received_events","type":"User","site_admin":false},"body":"…pecified for 1.10 and higher","created_at":"2016-03-11T10:17:45Z","updated_at":"2016-03-16T06:45:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa74be1eb7285efbdb7c929b3754bc423f0f350a","assignee":{"login":"daniceexi","id":10385985,"avatar_url":"https://avatars.githubusercontent.com/u/10385985?v=3","gravatar_id":"","url":"https://api.github.com/users/daniceexi","html_url":"https://github.com/daniceexi","followers_url":"https://api.github.com/users/daniceexi/followers","following_url":"https://api.github.com/users/daniceexi/following{/other_user}","gists_url":"https://api.github.com/users/daniceexi/gists{/gist_id}","starred_url":"https://api.github.com/users/daniceexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniceexi/subscriptions","organizations_url":"https://api.github.com/users/daniceexi/orgs","repos_url":"https://api.github.com/users/daniceexi/repos","events_url":"https://api.github.com/users/daniceexi/events{/privacy}","received_events_url":"https://api.github.com/users/daniceexi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/xcat2/xcat-core/milestones/6","html_url":"https://github.com/xcat2/xcat-core/milestones/2.12","labels_url":"https://api.github.com/repos/xcat2/xcat-core/milestones/6/labels","id":1369794,"number":6,"title":"2.12","description":null,"creator":{"login":"zet809","id":8222144,"avatar_url":"https://avatars.githubusercontent.com/u/8222144?v=3","gravatar_id":"","url":"https://api.github.com/users/zet809","html_url":"https://github.com/zet809","followers_url":"https://api.github.com/users/zet809/followers","following_url":"https://api.github.com/users/zet809/following{/other_user}","gists_url":"https://api.github.com/users/zet809/gists{/gist_id}","starred_url":"https://api.github.com/users/zet809/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zet809/subscriptions","organizations_url":"https://api.github.com/users/zet809/orgs","repos_url":"https://api.github.com/users/zet809/repos","events_url":"https://api.github.com/users/zet809/events{/privacy}","received_events_url":"https://api.github.com/users/zet809/received_events","type":"User","site_admin":false},"open_issues":109,"closed_issues":166,"state":"open","created_at":"2015-10-22T07:51:37Z","updated_at":"2016-03-16T06:03:35Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/794/commits","review_comments_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/794/comments","review_comment_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/issues/794/comments","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/f992b9d0bf5ce47582b119ccbd0968121274ae6b","head":{"label":"zet809:modify_setupdockerhost_for_mydocker0","ref":"modify_setupdockerhost_for_mydocker0","sha":"f992b9d0bf5ce47582b119ccbd0968121274ae6b","user":{"login":"zet809","id":8222144,"avatar_url":"https://avatars.githubusercontent.com/u/8222144?v=3","gravatar_id":"","url":"https://api.github.com/users/zet809","html_url":"https://github.com/zet809","followers_url":"https://api.github.com/users/zet809/followers","following_url":"https://api.github.com/users/zet809/following{/other_user}","gists_url":"https://api.github.com/users/zet809/gists{/gist_id}","starred_url":"https://api.github.com/users/zet809/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zet809/subscriptions","organizations_url":"https://api.github.com/users/zet809/orgs","repos_url":"https://api.github.com/users/zet809/repos","events_url":"https://api.github.com/users/zet809/events{/privacy}","received_events_url":"https://api.github.com/users/zet809/received_events","type":"User","site_admin":false},"repo":{"id":42983219,"name":"xcat-core","full_name":"zet809/xcat-core","owner":{"login":"zet809","id":8222144,"avatar_url":"https://avatars.githubusercontent.com/u/8222144?v=3","gravatar_id":"","url":"https://api.github.com/users/zet809","html_url":"https://github.com/zet809","followers_url":"https://api.github.com/users/zet809/followers","following_url":"https://api.github.com/users/zet809/following{/other_user}","gists_url":"https://api.github.com/users/zet809/gists{/gist_id}","starred_url":"https://api.github.com/users/zet809/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zet809/subscriptions","organizations_url":"https://api.github.com/users/zet809/orgs","repos_url":"https://api.github.com/users/zet809/repos","events_url":"https://api.github.com/users/zet809/events{/privacy}","received_events_url":"https://api.github.com/users/zet809/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zet809/xcat-core","description":"Code repo for xCAT core packages","fork":true,"url":"https://api.github.com/repos/zet809/xcat-core","forks_url":"https://api.github.com/repos/zet809/xcat-core/forks","keys_url":"https://api.github.com/repos/zet809/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zet809/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zet809/xcat-core/teams","hooks_url":"https://api.github.com/repos/zet809/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/zet809/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/zet809/xcat-core/events","assignees_url":"https://api.github.com/repos/zet809/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/zet809/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/zet809/xcat-core/tags","blobs_url":"https://api.github.com/repos/zet809/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zet809/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zet809/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/zet809/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zet809/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/zet809/xcat-core/languages","stargazers_url":"https://api.github.com/repos/zet809/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/zet809/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/zet809/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/zet809/xcat-core/subscription","commits_url":"https://api.github.com/repos/zet809/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/zet809/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/zet809/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/zet809/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/zet809/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/zet809/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zet809/xcat-core/merges","archive_url":"https://api.github.com/repos/zet809/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zet809/xcat-core/downloads","issues_url":"https://api.github.com/repos/zet809/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/zet809/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/zet809/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/zet809/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zet809/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/zet809/xcat-core/releases{/id}","deployments_url":"https://api.github.com/repos/zet809/xcat-core/deployments","created_at":"2015-09-23T06:43:10Z","updated_at":"2015-09-23T06:43:25Z","pushed_at":"2016-03-16T06:14:41Z","git_url":"git://github.com/zet809/xcat-core.git","ssh_url":"git@github.com:zet809/xcat-core.git","clone_url":"https://github.com/zet809/xcat-core.git","svn_url":"https://github.com/zet809/xcat-core","homepage":null,"size":182250,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xcat2:master","ref":"master","sha":"66a761c9a76892b4a1f4febf1db240f73c9c86a4","user":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"repo":{"id":27747508,"name":"xcat-core","full_name":"xcat2/xcat-core","owner":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xcat2/xcat-core","description":"Code repo for xCAT core packages","fork":false,"url":"https://api.github.com/repos/xcat2/xcat-core","forks_url":"https://api.github.com/repos/xcat2/xcat-core/forks","keys_url":"https://api.github.com/repos/xcat2/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xcat2/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xcat2/xcat-core/teams","hooks_url":"https://api.github.com/repos/xcat2/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/xcat2/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/xcat2/xcat-core/events","assignees_url":"https://api.github.com/repos/xcat2/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/xcat2/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/xcat2/xcat-core/tags","blobs_url":"https://api.github.com/repos/xcat2/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xcat2/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xcat2/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/xcat2/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/xcat2/xcat-core/languages","stargazers_url":"https://api.github.com/repos/xcat2/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/xcat2/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/xcat2/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/xcat2/xcat-core/subscription","commits_url":"https://api.github.com/repos/xcat2/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/xcat2/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/xcat2/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/xcat2/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/xcat2/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xcat2/xcat-core/merges","archive_url":"https://api.github.com/repos/xcat2/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xcat2/xcat-core/downloads","issues_url":"https://api.github.com/repos/xcat2/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/xcat2/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/xcat2/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/xcat2/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xcat2/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/xcat2/xcat-core/releases{/id}","deployments_url":"https://api.github.com/repos/xcat2/xcat-core/deployments","created_at":"2014-12-09T03:21:50Z","updated_at":"2016-02-18T16:32:24Z","pushed_at":"2016-03-16T06:32:41Z","git_url":"git://github.com/xcat2/xcat-core.git","ssh_url":"git@github.com:xcat2/xcat-core.git","clone_url":"https://github.com/xcat2/xcat-core.git","svn_url":"https://github.com/xcat2/xcat-core","homepage":null,"size":182466,"stargazers_count":33,"watchers_count":33,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":140,"forks":42,"open_issues":140,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/794"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/794"},"issue":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/794"},"comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/794/comments"},"review_comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/794/comments"},"review_comment":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/794/commits"},"statuses":{"href":"https://api.github.com/repos/xcat2/xcat-core/statuses/f992b9d0bf5ce47582b119ccbd0968121274ae6b"}}}}