{"action":"created","comment":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/29662409","id":29662409,"diff_hunk":"@@ -0,0 +1,341 @@\n+# -*- encoding: utf-8 -*-\n+\"\"\"\n+Usage::\n+\n+    hammer import [OPTIONS] SUBCOMMAND [ARG] ...\n+\n+Parameters::\n+\n+    SUBCOMMAND                    subcommand\n+    [ARG] ...                     subcommand arguments\n+\n+Subcommands::\n+\n+    activation-key                Import Activation Keys\n+                                  (from spacewalk-report activation-keys).\n+    all                           Load ALL data from a specified directory\n+                                  that is in spacewalk-export format.\n+    config-file                   Create puppet-modules from Configuration\n+                                  Channel content (from spacewalk-report\n+                                  config-files-latest).\n+    content-host                  Import Content Hosts\n+                                  (from spacewalk-report system-profiles).\n+    content-view                  Create Content Views based on local/cloned\n+                                  Channels (from spacewalk-export-channels).\n+    host-collection               Import Host Collections\n+                                  (from spacewalk-report system-groups).\n+    organization                  Import Organizations\n+                                  (from spacewalk-report users).\n+    repository                    Import repositories\n+                                  (from spacewalk-report repositories).\n+    repository-enable             Enable any Red Hat repositories\n+                                  accessible to any Organization\n+                                  (from spacewalk-report channels).\n+    template-snippet              Import template snippets\n+                                  (from spacewalk-report kickstart-scripts).\n+    user                          Import Users (from spacewalk-report users).\n+\"\"\"\n+\n+# import os.path\n+from robottelo.cli.base import Base\n+from robottelo.common import conf, ssh\n+\n+\n+class Import(Base):\n+    \"\"\"Imports configurations from another Satellite instances\"\"\"\n+\n+    command_base = 'import'\n+\n+    @staticmethod\n+    def prepare_import_data(tar_path=None):\n+        \"\"\"\n+        Fetch and uncompress the CSV files from the source\n+        \"\"\"\n+        # if path to tar file not specified, download the default one\n+        if tar_path is None:","path":"robottelo/cli/imprt.py","position":55,"original_position":55,"commit_id":"d7799d84fdda150e028a598401e2c63e23272aaf","original_commit_id":"d7799d84fdda150e028a598401e2c63e23272aaf","user":{"login":"elyezer","id":48132,"avatar_url":"https://avatars.githubusercontent.com/u/48132?v=3","gravatar_id":"","url":"https://api.github.com/users/elyezer","html_url":"https://github.com/elyezer","followers_url":"https://api.github.com/users/elyezer/followers","following_url":"https://api.github.com/users/elyezer/following{/other_user}","gists_url":"https://api.github.com/users/elyezer/gists{/gist_id}","starred_url":"https://api.github.com/users/elyezer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyezer/subscriptions","organizations_url":"https://api.github.com/users/elyezer/orgs","repos_url":"https://api.github.com/users/elyezer/repos","events_url":"https://api.github.com/users/elyezer/events{/privacy}","received_events_url":"https://api.github.com/users/elyezer/received_events","type":"User","site_admin":false},"body":"I think here is better to check if the tar_path starts with http and then download it otherwise it is a local path. That said only if the tar_path is not None.","created_at":"2015-05-05T12:05:27Z","updated_at":"2015-05-05T12:05:27Z","html_url":"https://github.com/SatelliteQE/robottelo/pull/2169#discussion_r29662409","pull_request_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169","_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/29662409"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2169#discussion_r29662409"},"pull_request":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169"}}},"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169","id":34705905,"html_url":"https://github.com/SatelliteQE/robottelo/pull/2169","diff_url":"https://github.com/SatelliteQE/robottelo/pull/2169.diff","patch_url":"https://github.com/SatelliteQE/robottelo/pull/2169.patch","issue_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2169","number":2169,"state":"open","locked":false,"title":"cli.imprt all subcommands implemented + initial test added","user":{"login":"rplevka","id":11773362,"avatar_url":"https://avatars.githubusercontent.com/u/11773362?v=3","gravatar_id":"","url":"https://api.github.com/users/rplevka","html_url":"https://github.com/rplevka","followers_url":"https://api.github.com/users/rplevka/followers","following_url":"https://api.github.com/users/rplevka/following{/other_user}","gists_url":"https://api.github.com/users/rplevka/gists{/gist_id}","starred_url":"https://api.github.com/users/rplevka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rplevka/subscriptions","organizations_url":"https://api.github.com/users/rplevka/orgs","repos_url":"https://api.github.com/users/rplevka/repos","events_url":"https://api.github.com/users/rplevka/events{/privacy}","received_events_url":"https://api.github.com/users/rplevka/received_events","type":"User","site_admin":false},"body":"Added robottelo.cli.imprt (`Import` class) to mimic `hammer import` subcommand and some initial tests.\r\nThis is will be mainly used to test sat5 -> sat6 transitioning.\r\n\r\nThanks for reviewing my code.","created_at":"2015-05-05T08:56:57Z","updated_at":"2015-05-05T12:05:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ee48dcd47dadeab03fd1566f96e6e7cb8c09392","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2169/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/d7799d84fdda150e028a598401e2c63e23272aaf","head":{"label":"rplevka:cli-import","ref":"cli-import","sha":"d7799d84fdda150e028a598401e2c63e23272aaf","user":{"login":"rplevka","id":11773362,"avatar_url":"https://avatars.githubusercontent.com/u/11773362?v=3","gravatar_id":"","url":"https://api.github.com/users/rplevka","html_url":"https://github.com/rplevka","followers_url":"https://api.github.com/users/rplevka/followers","following_url":"https://api.github.com/users/rplevka/following{/other_user}","gists_url":"https://api.github.com/users/rplevka/gists{/gist_id}","starred_url":"https://api.github.com/users/rplevka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rplevka/subscriptions","organizations_url":"https://api.github.com/users/rplevka/orgs","repos_url":"https://api.github.com/users/rplevka/repos","events_url":"https://api.github.com/users/rplevka/events{/privacy}","received_events_url":"https://api.github.com/users/rplevka/received_events","type":"User","site_admin":false},"repo":{"id":34329745,"name":"robottelo","full_name":"rplevka/robottelo","owner":{"login":"rplevka","id":11773362,"avatar_url":"https://avatars.githubusercontent.com/u/11773362?v=3","gravatar_id":"","url":"https://api.github.com/users/rplevka","html_url":"https://github.com/rplevka","followers_url":"https://api.github.com/users/rplevka/followers","following_url":"https://api.github.com/users/rplevka/following{/other_user}","gists_url":"https://api.github.com/users/rplevka/gists{/gist_id}","starred_url":"https://api.github.com/users/rplevka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rplevka/subscriptions","organizations_url":"https://api.github.com/users/rplevka/orgs","repos_url":"https://api.github.com/users/rplevka/repos","events_url":"https://api.github.com/users/rplevka/events{/privacy}","received_events_url":"https://api.github.com/users/rplevka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rplevka/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":true,"url":"https://api.github.com/repos/rplevka/robottelo","forks_url":"https://api.github.com/repos/rplevka/robottelo/forks","keys_url":"https://api.github.com/repos/rplevka/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rplevka/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rplevka/robottelo/teams","hooks_url":"https://api.github.com/repos/rplevka/robottelo/hooks","issue_events_url":"https://api.github.com/repos/rplevka/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/rplevka/robottelo/events","assignees_url":"https://api.github.com/repos/rplevka/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/rplevka/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/rplevka/robottelo/tags","blobs_url":"https://api.github.com/repos/rplevka/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rplevka/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rplevka/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/rplevka/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rplevka/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/rplevka/robottelo/languages","stargazers_url":"https://api.github.com/repos/rplevka/robottelo/stargazers","contributors_url":"https://api.github.com/repos/rplevka/robottelo/contributors","subscribers_url":"https://api.github.com/repos/rplevka/robottelo/subscribers","subscription_url":"https://api.github.com/repos/rplevka/robottelo/subscription","commits_url":"https://api.github.com/repos/rplevka/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/rplevka/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/rplevka/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/rplevka/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/rplevka/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/rplevka/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rplevka/robottelo/merges","archive_url":"https://api.github.com/repos/rplevka/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rplevka/robottelo/downloads","issues_url":"https://api.github.com/repos/rplevka/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/rplevka/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/rplevka/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/rplevka/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rplevka/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/rplevka/robottelo/releases{/id}","created_at":"2015-04-21T13:47:48Z","updated_at":"2015-05-04T13:34:43Z","pushed_at":"2015-05-05T09:15:08Z","git_url":"git://github.com/rplevka/robottelo.git","ssh_url":"git@github.com:rplevka/robottelo.git","clone_url":"https://github.com/rplevka/robottelo.git","svn_url":"https://github.com/rplevka/robottelo","homepage":"","size":7603,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SatelliteQE:master","ref":"master","sha":"8b7e8473f246fbce58228ac331b1f3e27561a6fa","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":4000279,"name":"robottelo","full_name":"SatelliteQE/robottelo","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":false,"url":"https://api.github.com/repos/SatelliteQE/robottelo","forks_url":"https://api.github.com/repos/SatelliteQE/robottelo/forks","keys_url":"https://api.github.com/repos/SatelliteQE/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/robottelo/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/robottelo/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/robottelo/events","assignees_url":"https://api.github.com/repos/SatelliteQE/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/robottelo/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/robottelo/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/robottelo/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/robottelo/merges","archive_url":"https://api.github.com/repos/SatelliteQE/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/robottelo/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/robottelo/releases{/id}","created_at":"2012-04-12T01:36:39Z","updated_at":"2015-05-01T13:51:25Z","pushed_at":"2015-05-05T11:58:36Z","git_url":"git://github.com/SatelliteQE/robottelo.git","ssh_url":"git@github.com:SatelliteQE/robottelo.git","clone_url":"https://github.com/SatelliteQE/robottelo.git","svn_url":"https://github.com/SatelliteQE/robottelo","homepage":"","size":18186,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":27,"mirror_url":null,"open_issues_count":132,"forks":27,"open_issues":132,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2169"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2169"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2169/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2169/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/d7799d84fdda150e028a598401e2c63e23272aaf"}}}}