{"action":"created","comment":{"url":"https://api.github.com/repos/fedora-modularity/conu/pulls/comments/141029361","pull_request_review_id":65181394,"id":141029361,"diff_hunk":"@@ -0,0 +1,84 @@\n+\"\"\"\n+Abstract class definitions for files in containers.\n+\"\"\"\n+\n+from conu.apidefs.container import Container\n+from conu.apidefs.image import Image\n+\n+\n+class File(object):\n+    \"\"\"\n+    File class definition which contains abstract methods. The instances should call the\n+    constructor\n+    \"\"\"\n+    def __init__(self, mount_dir):\n+        \"\"\"\n+        :param mount_dir: str, directory for mounting container\n+        \"\"\"\n+        self.container = None\n+        self.container_id = None\n+        self.image = None\n+        self.image_id = None\n+        self.mount_dir = mount_dir\n+\n+    def mount_container(self, container, container_id):\n+        \"\"\"\n+        mount a container to host system\n+        :param container: container\n+        :param container_id: str, unique identifier of this container\n+        :return: None\n+        \"\"\"\n+        if not isinstance(container, Container):\n+            raise RuntimeError(\"container argument is not an instance of Container class\")\n+        self.container = container\n+        self.container_id = container_id\n+        raise NotImplementedError(\"mount_container method is not implemented\")\n+\n+    def mount_image(self, image, image_id):\n+        \"\"\"\n+        mount an image to host system\n+        :param image: image\n+        :param image_id: str, unique identifier of this image\n+        :return: None\n+        \"\"\"\n+        if not isinstance(image, Image):\n+            raise RuntimeError(\"container argument is not an instance of Container class\")\n+        self.image = image\n+        self.image_id = image_id\n+        raise NotImplementedError(\"mount_container method is not implemented\")\n+\n+    def file_is_present(self, file_path):\n+        \"\"\"\n+        check if file 'file_path' is present in container\n+\n+        :param file_path: str, path to the file\n+        :return: True if file exists, False if file does not exist\n+        \"\"\"\n+        raise NotImplementedError(\"get_file method is not implemented\")\n+\n+    def directory_is_present(self, directory_name):\n+        \"\"\"\n+        check if directory 'directory_name' is present in container\n+\n+        :param directory_name: str, Directory to check\n+        :return: True if directory exists, False if directory does not exist\n+        \"\"\"\n+        raise NotImplementedError(\"directory_is_present is not implemented\")\n+\n+    def get_permissions(self, file_path):\n+        \"\"\"\n+        return a permissions for 'file_path'\n+        :param file_path: str, path to the file\n+        :return: str\n+        \"\"\"\n+\n+        raise NotImplementedError(\"get_permissions is not implemented\")\n+\n+    def get_selinux_context(self, file_path):","path":"conu/apidefs/file.py","position":77,"original_position":77,"commit_id":"357c53843056c06b52a02da97228097b62dbfe80","original_commit_id":"357c53843056c06b52a02da97228097b62dbfe80","user":{"login":"TomasTomecek","id":1662493,"avatar_url":"https://avatars0.githubusercontent.com/u/1662493?v=4","gravatar_id":"","url":"https://api.github.com/users/TomasTomecek","html_url":"https://github.com/TomasTomecek","followers_url":"https://api.github.com/users/TomasTomecek/followers","following_url":"https://api.github.com/users/TomasTomecek/following{/other_user}","gists_url":"https://api.github.com/users/TomasTomecek/gists{/gist_id}","starred_url":"https://api.github.com/users/TomasTomecek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomasTomecek/subscriptions","organizations_url":"https://api.github.com/users/TomasTomecek/orgs","repos_url":"https://api.github.com/users/TomasTomecek/repos","events_url":"https://api.github.com/users/TomasTomecek/events{/privacy}","received_events_url":"https://api.github.com/users/TomasTomecek/received_events","type":"User","site_admin":false},"body":"I like this one, can we also add it to container and image classes?\r\n\r\n(for implementation, we can either use native selinux python module, if it has such functionality, or use [`xattr`](https://pypi.python.org/pypi/xattr))","created_at":"2017-09-26T11:33:43Z","updated_at":"2017-09-26T11:36:31Z","html_url":"https://github.com/fedora-modularity/conu/pull/27#discussion_r141029361","pull_request_url":"https://api.github.com/repos/fedora-modularity/conu/pulls/27","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fedora-modularity/conu/pulls/comments/141029361"},"html":{"href":"https://github.com/fedora-modularity/conu/pull/27#discussion_r141029361"},"pull_request":{"href":"https://api.github.com/repos/fedora-modularity/conu/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/fedora-modularity/conu/pulls/27","id":143096735,"html_url":"https://github.com/fedora-modularity/conu/pull/27","diff_url":"https://github.com/fedora-modularity/conu/pull/27.diff","patch_url":"https://github.com/fedora-modularity/conu/pull/27.patch","issue_url":"https://api.github.com/repos/fedora-modularity/conu/issues/27","number":27,"state":"open","locked":false,"title":"Fixes #19 File abstraction class","user":{"login":"phracek","id":3416672,"avatar_url":"https://avatars2.githubusercontent.com/u/3416672?v=4","gravatar_id":"","url":"https://api.github.com/users/phracek","html_url":"https://github.com/phracek","followers_url":"https://api.github.com/users/phracek/followers","following_url":"https://api.github.com/users/phracek/following{/other_user}","gists_url":"https://api.github.com/users/phracek/gists{/gist_id}","starred_url":"https://api.github.com/users/phracek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phracek/subscriptions","organizations_url":"https://api.github.com/users/phracek/orgs","repos_url":"https://api.github.com/users/phracek/repos","events_url":"https://api.github.com/users/phracek/events{/privacy}","received_events_url":"https://api.github.com/users/phracek/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Petr \"Stone\" Hracek <phracek@redhat.com>\r\n\r\nFile abstraction class contains these functions:\r\n* mount_container for mounting container\r\n* mount_image for mounting image\r\n* file_is_present for checking if file exists\r\n* directory_is_present for checking if directory exists\r\n* get_permissions returns permissions for given file_path\r\n* get_selinux_context returns a selinux context for given file","created_at":"2017-09-26T10:31:37Z","updated_at":"2017-09-26T11:36:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66c3939bfb810bacfe518afa5c4f163ef9414489","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/fedora-modularity/conu/pulls/27/commits","review_comments_url":"https://api.github.com/repos/fedora-modularity/conu/pulls/27/comments","review_comment_url":"https://api.github.com/repos/fedora-modularity/conu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedora-modularity/conu/issues/27/comments","statuses_url":"https://api.github.com/repos/fedora-modularity/conu/statuses/357c53843056c06b52a02da97228097b62dbfe80","head":{"label":"phracek:file_interface","ref":"file_interface","sha":"357c53843056c06b52a02da97228097b62dbfe80","user":{"login":"phracek","id":3416672,"avatar_url":"https://avatars2.githubusercontent.com/u/3416672?v=4","gravatar_id":"","url":"https://api.github.com/users/phracek","html_url":"https://github.com/phracek","followers_url":"https://api.github.com/users/phracek/followers","following_url":"https://api.github.com/users/phracek/following{/other_user}","gists_url":"https://api.github.com/users/phracek/gists{/gist_id}","starred_url":"https://api.github.com/users/phracek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phracek/subscriptions","organizations_url":"https://api.github.com/users/phracek/orgs","repos_url":"https://api.github.com/users/phracek/repos","events_url":"https://api.github.com/users/phracek/events{/privacy}","received_events_url":"https://api.github.com/users/phracek/received_events","type":"User","site_admin":false},"repo":{"id":103511852,"name":"conu","full_name":"phracek/conu","owner":{"login":"phracek","id":3416672,"avatar_url":"https://avatars2.githubusercontent.com/u/3416672?v=4","gravatar_id":"","url":"https://api.github.com/users/phracek","html_url":"https://github.com/phracek","followers_url":"https://api.github.com/users/phracek/followers","following_url":"https://api.github.com/users/phracek/following{/other_user}","gists_url":"https://api.github.com/users/phracek/gists{/gist_id}","starred_url":"https://api.github.com/users/phracek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phracek/subscriptions","organizations_url":"https://api.github.com/users/phracek/orgs","repos_url":"https://api.github.com/users/phracek/repos","events_url":"https://api.github.com/users/phracek/events{/privacy}","received_events_url":"https://api.github.com/users/phracek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phracek/conu","description":"CONtainers Util functions to help you with testing of your containers.","fork":true,"url":"https://api.github.com/repos/phracek/conu","forks_url":"https://api.github.com/repos/phracek/conu/forks","keys_url":"https://api.github.com/repos/phracek/conu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phracek/conu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phracek/conu/teams","hooks_url":"https://api.github.com/repos/phracek/conu/hooks","issue_events_url":"https://api.github.com/repos/phracek/conu/issues/events{/number}","events_url":"https://api.github.com/repos/phracek/conu/events","assignees_url":"https://api.github.com/repos/phracek/conu/assignees{/user}","branches_url":"https://api.github.com/repos/phracek/conu/branches{/branch}","tags_url":"https://api.github.com/repos/phracek/conu/tags","blobs_url":"https://api.github.com/repos/phracek/conu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phracek/conu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phracek/conu/git/refs{/sha}","trees_url":"https://api.github.com/repos/phracek/conu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phracek/conu/statuses/{sha}","languages_url":"https://api.github.com/repos/phracek/conu/languages","stargazers_url":"https://api.github.com/repos/phracek/conu/stargazers","contributors_url":"https://api.github.com/repos/phracek/conu/contributors","subscribers_url":"https://api.github.com/repos/phracek/conu/subscribers","subscription_url":"https://api.github.com/repos/phracek/conu/subscription","commits_url":"https://api.github.com/repos/phracek/conu/commits{/sha}","git_commits_url":"https://api.github.com/repos/phracek/conu/git/commits{/sha}","comments_url":"https://api.github.com/repos/phracek/conu/comments{/number}","issue_comment_url":"https://api.github.com/repos/phracek/conu/issues/comments{/number}","contents_url":"https://api.github.com/repos/phracek/conu/contents/{+path}","compare_url":"https://api.github.com/repos/phracek/conu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phracek/conu/merges","archive_url":"https://api.github.com/repos/phracek/conu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phracek/conu/downloads","issues_url":"https://api.github.com/repos/phracek/conu/issues{/number}","pulls_url":"https://api.github.com/repos/phracek/conu/pulls{/number}","milestones_url":"https://api.github.com/repos/phracek/conu/milestones{/number}","notifications_url":"https://api.github.com/repos/phracek/conu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phracek/conu/labels{/name}","releases_url":"https://api.github.com/repos/phracek/conu/releases{/id}","deployments_url":"https://api.github.com/repos/phracek/conu/deployments","created_at":"2017-09-14T09:12:41Z","updated_at":"2017-09-14T09:12:43Z","pushed_at":"2017-09-26T10:29:14Z","git_url":"git://github.com/phracek/conu.git","ssh_url":"git@github.com:phracek/conu.git","clone_url":"https://github.com/phracek/conu.git","svn_url":"https://github.com/phracek/conu","homepage":"","size":45,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"fedora-modularity:master","ref":"master","sha":"d9546b17b8aa57d8dac0046ebbe87928b141d30f","user":{"login":"fedora-modularity","id":20321118,"avatar_url":"https://avatars0.githubusercontent.com/u/20321118?v=4","gravatar_id":"","url":"https://api.github.com/users/fedora-modularity","html_url":"https://github.com/fedora-modularity","followers_url":"https://api.github.com/users/fedora-modularity/followers","following_url":"https://api.github.com/users/fedora-modularity/following{/other_user}","gists_url":"https://api.github.com/users/fedora-modularity/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-modularity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-modularity/subscriptions","organizations_url":"https://api.github.com/users/fedora-modularity/orgs","repos_url":"https://api.github.com/users/fedora-modularity/repos","events_url":"https://api.github.com/users/fedora-modularity/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-modularity/received_events","type":"Organization","site_admin":false},"repo":{"id":103242244,"name":"conu","full_name":"fedora-modularity/conu","owner":{"login":"fedora-modularity","id":20321118,"avatar_url":"https://avatars0.githubusercontent.com/u/20321118?v=4","gravatar_id":"","url":"https://api.github.com/users/fedora-modularity","html_url":"https://github.com/fedora-modularity","followers_url":"https://api.github.com/users/fedora-modularity/followers","following_url":"https://api.github.com/users/fedora-modularity/following{/other_user}","gists_url":"https://api.github.com/users/fedora-modularity/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-modularity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-modularity/subscriptions","organizations_url":"https://api.github.com/users/fedora-modularity/orgs","repos_url":"https://api.github.com/users/fedora-modularity/repos","events_url":"https://api.github.com/users/fedora-modularity/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-modularity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedora-modularity/conu","description":"CONtainers Util functions to help you with testing of your containers.","fork":false,"url":"https://api.github.com/repos/fedora-modularity/conu","forks_url":"https://api.github.com/repos/fedora-modularity/conu/forks","keys_url":"https://api.github.com/repos/fedora-modularity/conu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedora-modularity/conu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedora-modularity/conu/teams","hooks_url":"https://api.github.com/repos/fedora-modularity/conu/hooks","issue_events_url":"https://api.github.com/repos/fedora-modularity/conu/issues/events{/number}","events_url":"https://api.github.com/repos/fedora-modularity/conu/events","assignees_url":"https://api.github.com/repos/fedora-modularity/conu/assignees{/user}","branches_url":"https://api.github.com/repos/fedora-modularity/conu/branches{/branch}","tags_url":"https://api.github.com/repos/fedora-modularity/conu/tags","blobs_url":"https://api.github.com/repos/fedora-modularity/conu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedora-modularity/conu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedora-modularity/conu/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedora-modularity/conu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedora-modularity/conu/statuses/{sha}","languages_url":"https://api.github.com/repos/fedora-modularity/conu/languages","stargazers_url":"https://api.github.com/repos/fedora-modularity/conu/stargazers","contributors_url":"https://api.github.com/repos/fedora-modularity/conu/contributors","subscribers_url":"https://api.github.com/repos/fedora-modularity/conu/subscribers","subscription_url":"https://api.github.com/repos/fedora-modularity/conu/subscription","commits_url":"https://api.github.com/repos/fedora-modularity/conu/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedora-modularity/conu/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedora-modularity/conu/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedora-modularity/conu/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedora-modularity/conu/contents/{+path}","compare_url":"https://api.github.com/repos/fedora-modularity/conu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedora-modularity/conu/merges","archive_url":"https://api.github.com/repos/fedora-modularity/conu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedora-modularity/conu/downloads","issues_url":"https://api.github.com/repos/fedora-modularity/conu/issues{/number}","pulls_url":"https://api.github.com/repos/fedora-modularity/conu/pulls{/number}","milestones_url":"https://api.github.com/repos/fedora-modularity/conu/milestones{/number}","notifications_url":"https://api.github.com/repos/fedora-modularity/conu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedora-modularity/conu/labels{/name}","releases_url":"https://api.github.com/repos/fedora-modularity/conu/releases{/id}","deployments_url":"https://api.github.com/repos/fedora-modularity/conu/deployments","created_at":"2017-09-12T08:14:37Z","updated_at":"2017-09-13T07:19:01Z","pushed_at":"2017-09-26T10:31:39Z","git_url":"git://github.com/fedora-modularity/conu.git","ssh_url":"git@github.com:fedora-modularity/conu.git","clone_url":"https://github.com/fedora-modularity/conu.git","svn_url":"https://github.com/fedora-modularity/conu","homepage":"","size":41,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":13,"forks":5,"open_issues":13,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fedora-modularity/conu/pulls/27"},"html":{"href":"https://github.com/fedora-modularity/conu/pull/27"},"issue":{"href":"https://api.github.com/repos/fedora-modularity/conu/issues/27"},"comments":{"href":"https://api.github.com/repos/fedora-modularity/conu/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/fedora-modularity/conu/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/fedora-modularity/conu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedora-modularity/conu/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/fedora-modularity/conu/statuses/357c53843056c06b52a02da97228097b62dbfe80"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"TomasTomecek"}}