{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments/184202346","pull_request_review_id":115350417,"id":184202346,"diff_hunk":"@@ -708,6 +718,70 @@ def report_event(self, message=\"\", is_success=True, duration=0):\n         add_event(name=self.ext_handler.name, version=ext_handler_version, message=message,\n                   op=self.operation, is_success=is_success, duration=duration)\n \n+    def try_get_pkg_file(self):\n+        \"\"\"\n+        Attempt to get the full name of an extension ZIP package that was downloaded\n+        based on the name and the version of the extension handler.\n+\n+        This is not a simple process. The extension name in goal state combines\n+        namespace and type, but the version is separate. When the agent downloads\n+        the extension from storage, the name separates namespace, type, and version.\n+\n+        This means the code has to figure out how to divide a combined namespace\n+        and type. This is not hard, but the inconsistency between systems is\n+        annoying.\n+\n+        Here are the naming conventions used in different places.\n+\n+        Goal State:\n+          name=\"<Namespace>.<Type>\" version=\"1.0.0\"\n+\n+        URL:\n+          \"<Namespace>__<Type>__<Version>\"\n+\n+        The code has to determine how to break namespace and type to properly\n+        compare the Goal State value with the URL value. The approach taken by\n+        the code below is to normalize the value to Goal State's view of the\n+        world.\n+\n+        Given a namespace of Microsoft.OSTCExtensions, a typeof CustomScriptForLinux,\n+          and a Version of 1.5.2.2\n+        Then the method will determine that\n+            name=\"Microsoft.OSTCExtensions.CustomScriptForLinux\" version=\"1.5.2.2\"\n+          is equivalent to\n+            \"Microsoft.OSTCExtensions__CustomScriptForLinux__1.5.2.2\n+          by normalizing both values to\n+            \"Microsoft.OSTCExtensions.CustomScriptForLinux.1.5.2.2\n+        And that the full path to the extension's archive is\n+            \"/var/lib/waagent/Microsoft.OSTCExtensions.CustomScriptForLinux.1.5.2.2.zip\"\n+\n+        :return: full path to package's .zip or None\n+        :rtype: str\n+        \"\"\"\n+        if self.pkg_file is not None:\n+            return self.pkg_file\n+\n+        def normalize_ext_name(f):\n+            parts = f.split('__')\n+            if len(parts) != 3:\n+                return None\n+            return \"{0}.{1}.{2}\".format(parts[0], parts[1], parts[2])\n+\n+        try:\n+            normalized_ext_name = \"{0}.{1}.zip\".format(","path":"azurelinuxagent/ga/exthandlers.py","position":85,"original_position":85,"commit_id":"76faaf3b06ffacf1726977b7fff5b9a513362388","original_commit_id":"76faaf3b06ffacf1726977b7fff5b9a513362388","user":{"login":"boumenot","id":91112,"avatar_url":"https://avatars2.githubusercontent.com/u/91112?v=4","gravatar_id":"","url":"https://api.github.com/users/boumenot","html_url":"https://github.com/boumenot","followers_url":"https://api.github.com/users/boumenot/followers","following_url":"https://api.github.com/users/boumenot/following{/other_user}","gists_url":"https://api.github.com/users/boumenot/gists{/gist_id}","starred_url":"https://api.github.com/users/boumenot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boumenot/subscriptions","organizations_url":"https://api.github.com/users/boumenot/orgs","repos_url":"https://api.github.com/users/boumenot/repos","events_url":"https://api.github.com/users/boumenot/events{/privacy}","received_events_url":"https://api.github.com/users/boumenot/received_events","type":"User","site_admin":false},"body":"Gah! I thought I corrected those, thank you!","created_at":"2018-04-25T20:53:44Z","updated_at":"2018-04-25T20:53:45Z","html_url":"https://github.com/Azure/WALinuxAgent/pull/1131#discussion_r184202346","pull_request_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments/184202346"},"html":{"href":"https://github.com/Azure/WALinuxAgent/pull/1131#discussion_r184202346"},"pull_request":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131"}},"in_reply_to_id":183923571},"pull_request":{"url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131","id":183889595,"html_url":"https://github.com/Azure/WALinuxAgent/pull/1131","diff_url":"https://github.com/Azure/WALinuxAgent/pull/1131.diff","patch_url":"https://github.com/Azure/WALinuxAgent/pull/1131.patch","issue_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/1131","number":1131,"state":"open","locked":false,"title":"delete extension package on uninstall","user":{"login":"boumenot","id":91112,"avatar_url":"https://avatars2.githubusercontent.com/u/91112?v=4","gravatar_id":"","url":"https://api.github.com/users/boumenot","html_url":"https://github.com/boumenot","followers_url":"https://api.github.com/users/boumenot/followers","following_url":"https://api.github.com/users/boumenot/following{/other_user}","gists_url":"https://api.github.com/users/boumenot/gists{/gist_id}","starred_url":"https://api.github.com/users/boumenot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boumenot/subscriptions","organizations_url":"https://api.github.com/users/boumenot/orgs","repos_url":"https://api.github.com/users/boumenot/repos","events_url":"https://api.github.com/users/boumenot/events{/privacy}","received_events_url":"https://api.github.com/users/boumenot/received_events","type":"User","site_admin":false},"body":"Delete the extension's package when an extension is uninstalled.  An extension may be uninstalled via an explicit action from the user, or due to an extension upgrade.\r\n\r\nCloses #1054 ","created_at":"2018-04-24T23:19:23Z","updated_at":"2018-04-25T20:53:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"871f7384c5ee149150bc487b6558954bbf42521d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131/commits","review_comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131/comments","review_comment_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/1131/comments","statuses_url":"https://api.github.com/repos/Azure/WALinuxAgent/statuses/76faaf3b06ffacf1726977b7fff5b9a513362388","head":{"label":"Azure:pr-delete-old-packages","ref":"pr-delete-old-packages","sha":"76faaf3b06ffacf1726977b7fff5b9a513362388","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":4576639,"name":"WALinuxAgent","full_name":"Azure/WALinuxAgent","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/WALinuxAgent","description":"Microsoft Azure Linux Guest Agent ","fork":false,"url":"https://api.github.com/repos/Azure/WALinuxAgent","forks_url":"https://api.github.com/repos/Azure/WALinuxAgent/forks","keys_url":"https://api.github.com/repos/Azure/WALinuxAgent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/WALinuxAgent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/WALinuxAgent/teams","hooks_url":"https://api.github.com/repos/Azure/WALinuxAgent/hooks","issue_events_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/WALinuxAgent/events","assignees_url":"https://api.github.com/repos/Azure/WALinuxAgent/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/WALinuxAgent/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/WALinuxAgent/tags","blobs_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/WALinuxAgent/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/WALinuxAgent/languages","stargazers_url":"https://api.github.com/repos/Azure/WALinuxAgent/stargazers","contributors_url":"https://api.github.com/repos/Azure/WALinuxAgent/contributors","subscribers_url":"https://api.github.com/repos/Azure/WALinuxAgent/subscribers","subscription_url":"https://api.github.com/repos/Azure/WALinuxAgent/subscription","commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/WALinuxAgent/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/WALinuxAgent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/WALinuxAgent/merges","archive_url":"https://api.github.com/repos/Azure/WALinuxAgent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/WALinuxAgent/downloads","issues_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/WALinuxAgent/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/WALinuxAgent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/WALinuxAgent/labels{/name}","releases_url":"https://api.github.com/repos/Azure/WALinuxAgent/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/WALinuxAgent/deployments","created_at":"2012-06-06T18:55:55Z","updated_at":"2018-04-25T11:49:25Z","pushed_at":"2018-04-25T18:01:47Z","git_url":"git://github.com/Azure/WALinuxAgent.git","ssh_url":"git@github.com:Azure/WALinuxAgent.git","clone_url":"https://github.com/Azure/WALinuxAgent.git","svn_url":"https://github.com/Azure/WALinuxAgent","homepage":"http://azure.microsoft.com/","size":7901,"stargazers_count":224,"watchers_count":224,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":190,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":190,"open_issues":33,"watchers":224,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"f5c3bb744fb845f3e85f9fb366b803d874103dbe","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":4576639,"name":"WALinuxAgent","full_name":"Azure/WALinuxAgent","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/WALinuxAgent","description":"Microsoft Azure Linux Guest Agent ","fork":false,"url":"https://api.github.com/repos/Azure/WALinuxAgent","forks_url":"https://api.github.com/repos/Azure/WALinuxAgent/forks","keys_url":"https://api.github.com/repos/Azure/WALinuxAgent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/WALinuxAgent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/WALinuxAgent/teams","hooks_url":"https://api.github.com/repos/Azure/WALinuxAgent/hooks","issue_events_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/WALinuxAgent/events","assignees_url":"https://api.github.com/repos/Azure/WALinuxAgent/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/WALinuxAgent/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/WALinuxAgent/tags","blobs_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/WALinuxAgent/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/WALinuxAgent/languages","stargazers_url":"https://api.github.com/repos/Azure/WALinuxAgent/stargazers","contributors_url":"https://api.github.com/repos/Azure/WALinuxAgent/contributors","subscribers_url":"https://api.github.com/repos/Azure/WALinuxAgent/subscribers","subscription_url":"https://api.github.com/repos/Azure/WALinuxAgent/subscription","commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/WALinuxAgent/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/WALinuxAgent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/WALinuxAgent/merges","archive_url":"https://api.github.com/repos/Azure/WALinuxAgent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/WALinuxAgent/downloads","issues_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/WALinuxAgent/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/WALinuxAgent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/WALinuxAgent/labels{/name}","releases_url":"https://api.github.com/repos/Azure/WALinuxAgent/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/WALinuxAgent/deployments","created_at":"2012-06-06T18:55:55Z","updated_at":"2018-04-25T11:49:25Z","pushed_at":"2018-04-25T18:01:47Z","git_url":"git://github.com/Azure/WALinuxAgent.git","ssh_url":"git@github.com:Azure/WALinuxAgent.git","clone_url":"https://github.com/Azure/WALinuxAgent.git","svn_url":"https://github.com/Azure/WALinuxAgent","homepage":"http://azure.microsoft.com/","size":7901,"stargazers_count":224,"watchers_count":224,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":190,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":190,"open_issues":33,"watchers":224,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131"},"html":{"href":"https://github.com/Azure/WALinuxAgent/pull/1131"},"issue":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/issues/1131"},"comments":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/issues/1131/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/1131/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/statuses/76faaf3b06ffacf1726977b7fff5b9a513362388"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"boumenot"}}