{"action":"created","comment":{"url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/comments/76967409","id":76967409,"diff_hunk":"@@ -0,0 +1,69 @@\n+# Copyright 2016 Cloudbase Solutions Srl\n+# All Rights Reserved.\n+#\n+#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n+#    not use this file except in compliance with the License. You may obtain\n+#    a copy of the License at\n+#\n+#         http://www.apache.org/licenses/LICENSE-2.0\n+#\n+#    Unless required by applicable law or agreed to in writing, software\n+#    distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+#    License for the specific language governing permissions and limitations\n+#    under the License.\n+import ntpath\n+\n+from argus.cbinit import base_config_generator as base\n+from argus.introspection.cloud import windows as introspect\n+from argus import util\n+\n+\n+class BasePopulatedCBInitConfig(base.BaseCBInitConfig):\n+    \"\"\"An object that holds the cloudbaseinit config.\"\"\"\n+\n+    def __init__(self, client):\n+        super(BasePopulatedCBInitConfig, self).__init__(client)\n+        self.config_specific_paths()\n+\n+    def set_conf_value(self, name, value=\"\"):\n+        \"\"\"Set a config value in Default section.\"\"\"\n+        self.conf.set(\"DEFAULT\", name, value)\n+\n+    def _execute(self, cmd, count=util.RETRY_COUNT, delay=util.RETRY_DELAY,\n+                 command_type=None):\n+        \"\"\"Execute until success and return only the standard output.\"\"\"\n+\n+        # A positive exit code will trigger the failure\n+        # in the underlying methods as an `ArgusError`.\n+        # Also, if the retrying limit is reached, `ArgusTimeoutError`\n+        # will be raised.\n+        return self._client.run_command_with_retry(\n+            cmd, count=count, delay=delay, command_type=command_type)[0]\n+\n+    def config_specific_paths(self):\n+        \"\"\"Populate the ConfigParser object with instance specific values.\"\"\"\n+        cbinit_dir = introspect.get_cbinit_dir(self._execute)\n+\n+        # set bsdtar path\n+        self.set_conf_value(\"bsdtar_path\",\n+                            ntpath.join(cbinit_dir, r'bin\\bsdtar.exe'))\n+        # set localscripts default\n+        self.set_conf_value(\"local_scripts_path\",\n+                            ntpath.join(cbinit_dir, 'LocalScripts\\\\'))\n+        # set logdir\n+        self.set_conf_value(\"logdir\",\n+                            ntpath.join(cbinit_dir, \"log\\\\\"))\n+        # set mtools path","path":"argus/cbinit/config_generator.py","position":57,"original_position":57,"commit_id":"62141ec91c4ec714b6cce469d2101daca3dfe6f4","original_commit_id":"62141ec91c4ec714b6cce469d2101daca3dfe6f4","user":{"login":"alexcoman","id":5760107,"avatar_url":"https://avatars.githubusercontent.com/u/5760107?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcoman","html_url":"https://github.com/alexcoman","followers_url":"https://api.github.com/users/alexcoman/followers","following_url":"https://api.github.com/users/alexcoman/following{/other_user}","gists_url":"https://api.github.com/users/alexcoman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcoman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcoman/subscriptions","organizations_url":"https://api.github.com/users/alexcoman/orgs","repos_url":"https://api.github.com/users/alexcoman/repos","events_url":"https://api.github.com/users/alexcoman/events{/privacy}","received_events_url":"https://api.github.com/users/alexcoman/received_events","type":"User","site_admin":false},"body":"The comment is useless. ","created_at":"2016-08-31T11:01:38Z","updated_at":"2016-08-31T11:01:38Z","html_url":"https://github.com/cloudbase/cloudbase-init-ci/pull/20#discussion_r76967409","pull_request_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/comments/76967409"},"html":{"href":"https://github.com/cloudbase/cloudbase-init-ci/pull/20#discussion_r76967409"},"pull_request":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20","id":77585314,"html_url":"https://github.com/cloudbase/cloudbase-init-ci/pull/20","diff_url":"https://github.com/cloudbase/cloudbase-init-ci/pull/20.diff","patch_url":"https://github.com/cloudbase/cloudbase-init-ci/pull/20.patch","issue_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/issues/20","number":20,"state":"open","locked":false,"title":"Feature/cb init config generator","user":{"login":"micumatei","id":4560298,"avatar_url":"https://avatars.githubusercontent.com/u/4560298?v=3","gravatar_id":"","url":"https://api.github.com/users/micumatei","html_url":"https://github.com/micumatei","followers_url":"https://api.github.com/users/micumatei/followers","following_url":"https://api.github.com/users/micumatei/following{/other_user}","gists_url":"https://api.github.com/users/micumatei/gists{/gist_id}","starred_url":"https://api.github.com/users/micumatei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micumatei/subscriptions","organizations_url":"https://api.github.com/users/micumatei/orgs","repos_url":"https://api.github.com/users/micumatei/repos","events_url":"https://api.github.com/users/micumatei/events{/privacy}","received_events_url":"https://api.github.com/users/micumatei/received_events","type":"User","site_admin":false},"body":"- [ ] Test x86 image\r\n- [x] Test x64 image","created_at":"2016-07-15T09:11:01Z","updated_at":"2016-08-31T11:01:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18d04e74239ce2863b3c03febc8f942245b055d9","assignee":{"login":"alexcoman","id":5760107,"avatar_url":"https://avatars.githubusercontent.com/u/5760107?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcoman","html_url":"https://github.com/alexcoman","followers_url":"https://api.github.com/users/alexcoman/followers","following_url":"https://api.github.com/users/alexcoman/following{/other_user}","gists_url":"https://api.github.com/users/alexcoman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcoman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcoman/subscriptions","organizations_url":"https://api.github.com/users/alexcoman/orgs","repos_url":"https://api.github.com/users/alexcoman/repos","events_url":"https://api.github.com/users/alexcoman/events{/privacy}","received_events_url":"https://api.github.com/users/alexcoman/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexcoman","id":5760107,"avatar_url":"https://avatars.githubusercontent.com/u/5760107?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcoman","html_url":"https://github.com/alexcoman","followers_url":"https://api.github.com/users/alexcoman/followers","following_url":"https://api.github.com/users/alexcoman/following{/other_user}","gists_url":"https://api.github.com/users/alexcoman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcoman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcoman/subscriptions","organizations_url":"https://api.github.com/users/alexcoman/orgs","repos_url":"https://api.github.com/users/alexcoman/repos","events_url":"https://api.github.com/users/alexcoman/events{/privacy}","received_events_url":"https://api.github.com/users/alexcoman/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20/commits","review_comments_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20/comments","review_comment_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/issues/20/comments","statuses_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/statuses/62141ec91c4ec714b6cce469d2101daca3dfe6f4","head":{"label":"micumatei:feature/cb_init_config_generator","ref":"feature/cb_init_config_generator","sha":"62141ec91c4ec714b6cce469d2101daca3dfe6f4","user":{"login":"micumatei","id":4560298,"avatar_url":"https://avatars.githubusercontent.com/u/4560298?v=3","gravatar_id":"","url":"https://api.github.com/users/micumatei","html_url":"https://github.com/micumatei","followers_url":"https://api.github.com/users/micumatei/followers","following_url":"https://api.github.com/users/micumatei/following{/other_user}","gists_url":"https://api.github.com/users/micumatei/gists{/gist_id}","starred_url":"https://api.github.com/users/micumatei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micumatei/subscriptions","organizations_url":"https://api.github.com/users/micumatei/orgs","repos_url":"https://api.github.com/users/micumatei/repos","events_url":"https://api.github.com/users/micumatei/events{/privacy}","received_events_url":"https://api.github.com/users/micumatei/received_events","type":"User","site_admin":false},"repo":{"id":58729237,"name":"cloudbase-init-ci","full_name":"micumatei/cloudbase-init-ci","owner":{"login":"micumatei","id":4560298,"avatar_url":"https://avatars.githubusercontent.com/u/4560298?v=3","gravatar_id":"","url":"https://api.github.com/users/micumatei","html_url":"https://github.com/micumatei","followers_url":"https://api.github.com/users/micumatei/followers","following_url":"https://api.github.com/users/micumatei/following{/other_user}","gists_url":"https://api.github.com/users/micumatei/gists{/gist_id}","starred_url":"https://api.github.com/users/micumatei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micumatei/subscriptions","organizations_url":"https://api.github.com/users/micumatei/orgs","repos_url":"https://api.github.com/users/micumatei/repos","events_url":"https://api.github.com/users/micumatei/events{/privacy}","received_events_url":"https://api.github.com/users/micumatei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/micumatei/cloudbase-init-ci","description":"Continuous integration testing framework for Cloudbase-Init","fork":true,"url":"https://api.github.com/repos/micumatei/cloudbase-init-ci","forks_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/forks","keys_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/teams","hooks_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/hooks","issue_events_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/issues/events{/number}","events_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/events","assignees_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/assignees{/user}","branches_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/branches{/branch}","tags_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/tags","blobs_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/git/refs{/sha}","trees_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/statuses/{sha}","languages_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/languages","stargazers_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/stargazers","contributors_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/contributors","subscribers_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/subscribers","subscription_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/subscription","commits_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/commits{/sha}","git_commits_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/git/commits{/sha}","comments_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/comments{/number}","issue_comment_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/issues/comments{/number}","contents_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/contents/{+path}","compare_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/merges","archive_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/downloads","issues_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/issues{/number}","pulls_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/pulls{/number}","milestones_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/milestones{/number}","notifications_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/labels{/name}","releases_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/releases{/id}","deployments_url":"https://api.github.com/repos/micumatei/cloudbase-init-ci/deployments","created_at":"2016-05-13T10:30:36Z","updated_at":"2016-07-20T13:17:57Z","pushed_at":"2016-08-31T10:43:38Z","git_url":"git://github.com/micumatei/cloudbase-init-ci.git","ssh_url":"git@github.com:micumatei/cloudbase-init-ci.git","clone_url":"https://github.com/micumatei/cloudbase-init-ci.git","svn_url":"https://github.com/micumatei/cloudbase-init-ci","homepage":null,"size":1080,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"cloudbase:master","ref":"master","sha":"3255b9580ab220e5b5b4d467406d4b85366c1ed3","user":{"login":"cloudbase","id":2104303,"avatar_url":"https://avatars.githubusercontent.com/u/2104303?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudbase","html_url":"https://github.com/cloudbase","followers_url":"https://api.github.com/users/cloudbase/followers","following_url":"https://api.github.com/users/cloudbase/following{/other_user}","gists_url":"https://api.github.com/users/cloudbase/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudbase/subscriptions","organizations_url":"https://api.github.com/users/cloudbase/orgs","repos_url":"https://api.github.com/users/cloudbase/repos","events_url":"https://api.github.com/users/cloudbase/events{/privacy}","received_events_url":"https://api.github.com/users/cloudbase/received_events","type":"Organization","site_admin":false},"repo":{"id":30780249,"name":"cloudbase-init-ci","full_name":"cloudbase/cloudbase-init-ci","owner":{"login":"cloudbase","id":2104303,"avatar_url":"https://avatars.githubusercontent.com/u/2104303?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudbase","html_url":"https://github.com/cloudbase","followers_url":"https://api.github.com/users/cloudbase/followers","following_url":"https://api.github.com/users/cloudbase/following{/other_user}","gists_url":"https://api.github.com/users/cloudbase/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudbase/subscriptions","organizations_url":"https://api.github.com/users/cloudbase/orgs","repos_url":"https://api.github.com/users/cloudbase/repos","events_url":"https://api.github.com/users/cloudbase/events{/privacy}","received_events_url":"https://api.github.com/users/cloudbase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudbase/cloudbase-init-ci","description":"Continuous integration testing framework for Cloudbase-Init","fork":false,"url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci","forks_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/forks","keys_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/teams","hooks_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/hooks","issue_events_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/issues/events{/number}","events_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/events","assignees_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/assignees{/user}","branches_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/branches{/branch}","tags_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/tags","blobs_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/languages","stargazers_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/stargazers","contributors_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/contributors","subscribers_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/subscribers","subscription_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/subscription","commits_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/contents/{+path}","compare_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/merges","archive_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/downloads","issues_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/issues{/number}","pulls_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/labels{/name}","releases_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/releases{/id}","deployments_url":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/deployments","created_at":"2015-02-13T23:09:06Z","updated_at":"2016-04-08T12:36:45Z","pushed_at":"2016-08-31T10:43:38Z","git_url":"git://github.com/cloudbase/cloudbase-init-ci.git","ssh_url":"git@github.com:cloudbase/cloudbase-init-ci.git","clone_url":"https://github.com/cloudbase/cloudbase-init-ci.git","svn_url":"https://github.com/cloudbase/cloudbase-init-ci","homepage":null,"size":1053,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20"},"html":{"href":"https://github.com/cloudbase/cloudbase-init-ci/pull/20"},"issue":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/issues/20"},"comments":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/cloudbase/cloudbase-init-ci/statuses/62141ec91c4ec714b6cce469d2101daca3dfe6f4"}}}}
{"actor":{"display_login":"alexcoman"}}