{"action":"created","comment":{"url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/comments/228342324","pull_request_review_id":168596257,"id":228342324,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODM0MjMyNA==","diff_hunk":"@@ -19,46 +35,67 @@\n VERSION_1_CHECK = \"openstack-tripleo-heat-templates-8.0.2-4.el7ost.noarch\"\n VERSION_2_CHECK = \"openstack-tripleo-heat-templates-8.0.2-43.el7ost.noarch\"\n VERSION_3_CHECK = \"openstack-tripleo-heat-templates-8.0.4-20.el7ost.noarch\"\n-\n PRE_VERSION_1_DIFF = \"diff_OSPD13_8.0.2-4\"\n VERSION_2_DIFF = \"diff_OSPD13_8.0.2-43\"\n VERSION_3_DIFF = \"diff_OSPD13_8.0.4-20\"\n \n \n-if len(sys.argv) != 1:\n-    print \"Usage: %s\" % sys.argv[0]\n-    sys.exit(1)\n-\n def version_compare((e1, v1, r1), (e2, v2, r2)):\n     return rpm.labelCompare((e1, v1, r1), (e2, v2, r2))\n \n-version = subprocess.check_output(['rpm', '-qa', 'openstack-tripleo-heat-templates'])\n \n-(e0, v0, r0) = stringToVersion(version)\n-(e1, v1, r1) = stringToVersion(VERSION_1_CHECK)\n-(e2, v2, r2) = stringToVersion(VERSION_2_CHECK)\n-(e3, v3, r3) = stringToVersion(VERSION_3_CHECK)\n+def file_exists(filename):\n+    if not os.path.exists(filename):\n+        print \"File: %s is not present in the current directory. \" \\\n+              \"Please check!!\" % filename\n+        sys.exit(1)\n+    return filename\n+\n+\n+def main():\n+\n+    len(sys.argv) != 1:\n+        print \"Usage: %s\" % sys.argv[0]\n+        sys.exit(1)\n+\n+    version = subprocess.check_output(\n+        ['rpm', '-qa', 'openstack-tripleo-heat-templates']\n+    )\n+\n+    (e0, v0, r0) = stringToVersion(version)\n+    (e1, v1, r1) = stringToVersion(VERSION_1_CHECK)\n+    (e2, v2, r2) = stringToVersion(VERSION_2_CHECK)\n+    (e3, v3, r3) = stringToVersion(VERSION_3_CHECK)\n+\n+    args = \"patch -p0 -N -d /usr/share\"\n+\n+    # Compare versions\n+    version_1_rc = version_compare((e0, v0, r0), (e1, v1, r1))\n+    version_2_rc = version_compare((e0, v0, r0), (e2, v2, r2))\n+    version_3_rc = version_compare((e0, v0, r0), (e3, v3, r3))\n+\n+    if version_1_rc <= 0:\n+        args = args + \" < \" + PRE_VERSION_1_DIFF","path":"tripleo-heat-templates-diff/apply_patch.py","position":83,"original_position":83,"commit_id":"9f7a174bf5f385d02981a1b26956d0c613635863","original_commit_id":"9f7a174bf5f385d02981a1b26956d0c613635863","user":{"login":"psairam","id":33671427,"node_id":"MDQ6VXNlcjMzNjcxNDI3","avatar_url":"https://avatars1.githubusercontent.com/u/33671427?v=4","gravatar_id":"","url":"https://api.github.com/users/psairam","html_url":"https://github.com/psairam","followers_url":"https://api.github.com/users/psairam/followers","following_url":"https://api.github.com/users/psairam/following{/other_user}","gists_url":"https://api.github.com/users/psairam/gists{/gist_id}","starred_url":"https://api.github.com/users/psairam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psairam/subscriptions","organizations_url":"https://api.github.com/users/psairam/orgs","repos_url":"https://api.github.com/users/psairam/repos","events_url":"https://api.github.com/users/psairam/events{/privacy}","received_events_url":"https://api.github.com/users/psairam/received_events","type":"User","site_admin":false},"body":"I am comparing with OSPD-10 changes, did you forgot to call file_exists here and below as well?","created_at":"2018-10-25T21:33:47Z","updated_at":"2018-10-25T21:33:47Z","html_url":"https://github.com/nuagenetworks/nuage-ospdirector/pull/16#discussion_r228342324","pull_request_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/comments/228342324"},"html":{"href":"https://github.com/nuagenetworks/nuage-ospdirector/pull/16#discussion_r228342324"},"pull_request":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16","id":225619504,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NjE5NTA0","html_url":"https://github.com/nuagenetworks/nuage-ospdirector/pull/16","diff_url":"https://github.com/nuagenetworks/nuage-ospdirector/pull/16.diff","patch_url":"https://github.com/nuagenetworks/nuage-ospdirector/pull/16.patch","issue_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/issues/16","number":16,"state":"open","locked":false,"title":"adding some sanity checks to file","user":{"login":"sunny-verma","id":10456669,"node_id":"MDQ6VXNlcjEwNDU2NjY5","avatar_url":"https://avatars3.githubusercontent.com/u/10456669?v=4","gravatar_id":"","url":"https://api.github.com/users/sunny-verma","html_url":"https://github.com/sunny-verma","followers_url":"https://api.github.com/users/sunny-verma/followers","following_url":"https://api.github.com/users/sunny-verma/following{/other_user}","gists_url":"https://api.github.com/users/sunny-verma/gists{/gist_id}","starred_url":"https://api.github.com/users/sunny-verma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunny-verma/subscriptions","organizations_url":"https://api.github.com/users/sunny-verma/orgs","repos_url":"https://api.github.com/users/sunny-verma/repos","events_url":"https://api.github.com/users/sunny-verma/events{/privacy}","received_events_url":"https://api.github.com/users/sunny-verma/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-25T04:20:10Z","updated_at":"2018-10-25T21:33:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7747fa1be738ca8650e1e2a8a7a20fba345af6a5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16/commits","review_comments_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16/comments","review_comment_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/issues/16/comments","statuses_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/statuses/9f7a174bf5f385d02981a1b26956d0c613635863","head":{"label":"sunny-verma:OSPD13","ref":"OSPD13","sha":"9f7a174bf5f385d02981a1b26956d0c613635863","user":{"login":"sunny-verma","id":10456669,"node_id":"MDQ6VXNlcjEwNDU2NjY5","avatar_url":"https://avatars3.githubusercontent.com/u/10456669?v=4","gravatar_id":"","url":"https://api.github.com/users/sunny-verma","html_url":"https://github.com/sunny-verma","followers_url":"https://api.github.com/users/sunny-verma/followers","following_url":"https://api.github.com/users/sunny-verma/following{/other_user}","gists_url":"https://api.github.com/users/sunny-verma/gists{/gist_id}","starred_url":"https://api.github.com/users/sunny-verma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunny-verma/subscriptions","organizations_url":"https://api.github.com/users/sunny-verma/orgs","repos_url":"https://api.github.com/users/sunny-verma/repos","events_url":"https://api.github.com/users/sunny-verma/events{/privacy}","received_events_url":"https://api.github.com/users/sunny-verma/received_events","type":"User","site_admin":false},"repo":{"id":152610423,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI2MTA0MjM=","name":"nuage-ospdirector","full_name":"sunny-verma/nuage-ospdirector","private":false,"owner":{"login":"sunny-verma","id":10456669,"node_id":"MDQ6VXNlcjEwNDU2NjY5","avatar_url":"https://avatars3.githubusercontent.com/u/10456669?v=4","gravatar_id":"","url":"https://api.github.com/users/sunny-verma","html_url":"https://github.com/sunny-verma","followers_url":"https://api.github.com/users/sunny-verma/followers","following_url":"https://api.github.com/users/sunny-verma/following{/other_user}","gists_url":"https://api.github.com/users/sunny-verma/gists{/gist_id}","starred_url":"https://api.github.com/users/sunny-verma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunny-verma/subscriptions","organizations_url":"https://api.github.com/users/sunny-verma/orgs","repos_url":"https://api.github.com/users/sunny-verma/repos","events_url":"https://api.github.com/users/sunny-verma/events{/privacy}","received_events_url":"https://api.github.com/users/sunny-verma/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sunny-verma/nuage-ospdirector","description":"OSP Director integration for Nuage VSP","fork":true,"url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector","forks_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/forks","keys_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/teams","hooks_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/hooks","issue_events_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/issues/events{/number}","events_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/events","assignees_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/assignees{/user}","branches_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/branches{/branch}","tags_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/tags","blobs_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/git/refs{/sha}","trees_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/statuses/{sha}","languages_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/languages","stargazers_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/stargazers","contributors_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/contributors","subscribers_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/subscribers","subscription_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/subscription","commits_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/commits{/sha}","git_commits_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/git/commits{/sha}","comments_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/comments{/number}","issue_comment_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/issues/comments{/number}","contents_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/contents/{+path}","compare_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/merges","archive_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/downloads","issues_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/issues{/number}","pulls_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/pulls{/number}","milestones_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/milestones{/number}","notifications_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/labels{/name}","releases_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/releases{/id}","deployments_url":"https://api.github.com/repos/sunny-verma/nuage-ospdirector/deployments","created_at":"2018-10-11T15:01:41Z","updated_at":"2018-10-11T15:01:44Z","pushed_at":"2018-10-25T04:19:54Z","git_url":"git://github.com/sunny-verma/nuage-ospdirector.git","ssh_url":"git@github.com:sunny-verma/nuage-ospdirector.git","clone_url":"https://github.com/sunny-verma/nuage-ospdirector.git","svn_url":"https://github.com/sunny-verma/nuage-ospdirector","homepage":"https://github.com/nuagenetworks/nuage-ospdirector/wiki","size":773,"stargazers_count":0,"watchers_count":0,"language":"Puppet","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nuagenetworks:OSPD13","ref":"OSPD13","sha":"44161437fe149a6a2376207ad8257a01e1bcb633","user":{"login":"nuagenetworks","id":3334345,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzQzNDU=","avatar_url":"https://avatars1.githubusercontent.com/u/3334345?v=4","gravatar_id":"","url":"https://api.github.com/users/nuagenetworks","html_url":"https://github.com/nuagenetworks","followers_url":"https://api.github.com/users/nuagenetworks/followers","following_url":"https://api.github.com/users/nuagenetworks/following{/other_user}","gists_url":"https://api.github.com/users/nuagenetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/nuagenetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuagenetworks/subscriptions","organizations_url":"https://api.github.com/users/nuagenetworks/orgs","repos_url":"https://api.github.com/users/nuagenetworks/repos","events_url":"https://api.github.com/users/nuagenetworks/events{/privacy}","received_events_url":"https://api.github.com/users/nuagenetworks/received_events","type":"Organization","site_admin":false},"repo":{"id":81388555,"node_id":"MDEwOlJlcG9zaXRvcnk4MTM4ODU1NQ==","name":"nuage-ospdirector","full_name":"nuagenetworks/nuage-ospdirector","private":false,"owner":{"login":"nuagenetworks","id":3334345,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzQzNDU=","avatar_url":"https://avatars1.githubusercontent.com/u/3334345?v=4","gravatar_id":"","url":"https://api.github.com/users/nuagenetworks","html_url":"https://github.com/nuagenetworks","followers_url":"https://api.github.com/users/nuagenetworks/followers","following_url":"https://api.github.com/users/nuagenetworks/following{/other_user}","gists_url":"https://api.github.com/users/nuagenetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/nuagenetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuagenetworks/subscriptions","organizations_url":"https://api.github.com/users/nuagenetworks/orgs","repos_url":"https://api.github.com/users/nuagenetworks/repos","events_url":"https://api.github.com/users/nuagenetworks/events{/privacy}","received_events_url":"https://api.github.com/users/nuagenetworks/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nuagenetworks/nuage-ospdirector","description":"OSP Director integration for Nuage VSP","fork":false,"url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector","forks_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/forks","keys_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/teams","hooks_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/hooks","issue_events_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/issues/events{/number}","events_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/events","assignees_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/assignees{/user}","branches_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/branches{/branch}","tags_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/tags","blobs_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/statuses/{sha}","languages_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/languages","stargazers_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/stargazers","contributors_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/contributors","subscribers_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/subscribers","subscription_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/subscription","commits_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/contents/{+path}","compare_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/merges","archive_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/downloads","issues_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/issues{/number}","pulls_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls{/number}","milestones_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/milestones{/number}","notifications_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/labels{/name}","releases_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/releases{/id}","deployments_url":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/deployments","created_at":"2017-02-08T23:51:42Z","updated_at":"2018-03-16T12:51:55Z","pushed_at":"2018-10-25T04:20:10Z","git_url":"git://github.com/nuagenetworks/nuage-ospdirector.git","ssh_url":"git@github.com:nuagenetworks/nuage-ospdirector.git","clone_url":"https://github.com/nuagenetworks/nuage-ospdirector.git","svn_url":"https://github.com/nuagenetworks/nuage-ospdirector","homepage":"https://github.com/nuagenetworks/nuage-ospdirector/wiki","size":768,"stargazers_count":8,"watchers_count":8,"language":"Puppet","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":19,"open_issues":10,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16"},"html":{"href":"https://github.com/nuagenetworks/nuage-ospdirector/pull/16"},"issue":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/issues/16"},"comments":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/nuagenetworks/nuage-ospdirector/statuses/9f7a174bf5f385d02981a1b26956d0c613635863"}},"author_association":"NONE"}}
{"actor":{"display_login":"psairam"}}