{"action":"closed","number":16628,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/16628","id":76619963,"html_url":"https://github.com/ansible/ansible/pull/16628","diff_url":"https://github.com/ansible/ansible/pull/16628.diff","patch_url":"https://github.com/ansible/ansible/pull/16628.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/16628","number":16628,"state":"closed","locked":false,"title":"Fixes #163 in galaxy-issues","user":{"login":"s-hertel","id":19572925,"avatar_url":"https://avatars.githubusercontent.com/u/19572925?v=3","gravatar_id":"","url":"https://api.github.com/users/s-hertel","html_url":"https://github.com/s-hertel","followers_url":"https://api.github.com/users/s-hertel/followers","following_url":"https://api.github.com/users/s-hertel/following{/other_user}","gists_url":"https://api.github.com/users/s-hertel/gists{/gist_id}","starred_url":"https://api.github.com/users/s-hertel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-hertel/subscriptions","organizations_url":"https://api.github.com/users/s-hertel/orgs","repos_url":"https://api.github.com/users/s-hertel/repos","events_url":"https://api.github.com/users/s-hertel/events{/privacy}","received_events_url":"https://api.github.com/users/s-hertel/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n - Bugfix Pull Request\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.1.0.0\r\n  config file =\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\nThe method uses the variable baseurl which is determined in the g_connect function. Without the g_connect decorator baseurl == None and when trying to import it results in trying to open a url of None/imports/. This doesn't work so the program tries to determine the type of the url, and then because that doesn't work either (None/imports/ is not a valid url) a ValueError is raised. I added the decorator. Fixes #163 of galaxy-issues.\r\n\r\n```\r\nbefore fix:\r\nSuccesfully logged into Galaxy as s-hertel\r\nshertel-OSX:~ shertel$ ansible-galaxy import s-hertel test_role -vvv\r\nNo config file found; using defaults\r\nOpened /Users/shertel/.ansible_galaxy\r\nValidate TLS certificates: True\r\nNone/imports/\r\nERROR! Unexpected Exception: unknown url type: None/imports/\r\nthe full traceback was:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/bin/ansible-galaxy\", line 92, in <module>\r\n    exit_code = cli.run()\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/cli/galaxy.py\", line 153, in run\r\n    self.execute()\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/cli/__init__.py\", line 100, in execute\r\n    fn()\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/cli/galaxy.py\", line 596, in execute_import\r\n    task = self.api.create_import_task(github_user, github_repo, reference=self.options.reference)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/galaxy/api.py\", line 143, in create_import_task\r\n    data = self.__call_galaxy(url, args=args)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/galaxy/api.py\", line 56, in wrapped\r\n    return method(self, *args, **kwargs)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/galaxy/api.py\", line 95, in __call_galaxy\r\n    resp = open_url(url, data=args, validate_certs=self._validate_certs, headers=headers, method=method)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/module_utils/urls.py\", line 839, in open_url\r\n    r = urllib2.urlopen(*urlopen_args)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py\", line 154, in urlopen\r\n    return opener.open(url, data, timeout)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py\", line 422, in open\r\n    protocol = req.get_type()\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py\", line 285, in get_type\r\n    raise ValueError, \"unknown url type: %s\" % self.__original\r\nValueError: unknown url type: None/imports/\r\n\r\nafter fix:\r\nSuccesfully logged into Galaxy as s-hertel\r\nshertel-OSX:~ shertel$ ansible-galaxy import s-hertel test_role -vvv\r\nNo config file found; using defaults\r\nOpened /Users/shertel/.ansible_galaxy\r\nValidate TLS certificates: True\r\nhttps://galaxy.ansible.com/api/v1/imports/\r\nSuccessfully submitted import request 19264\r\nhttps://galaxy.ansible.com/api/v1/imports/?id=19264\r\nStarting import 19264: role_name=test_role repo=s-hertel/test_role ref=\r\nRetrieving Github repo s-hertel/test_role\r\nhttps://galaxy.ansible.com/api/v1/imports/?id=19264\r\nAccessing branch: master\r\nParsing and validating meta/main.yml\r\n(and then fails, but only because I didn't put anything in meta/main.yml)\r\n```","created_at":"2016-07-07T15:51:32Z","updated_at":"2016-07-21T18:05:07Z","closed_at":"2016-07-21T18:05:07Z","merged_at":null,"merge_commit_sha":"1171fa294f550fb54194a184bb821db1fca8a479","assignee":{"login":"ryansb","id":636610,"avatar_url":"https://avatars.githubusercontent.com/u/636610?v=3","gravatar_id":"","url":"https://api.github.com/users/ryansb","html_url":"https://github.com/ryansb","followers_url":"https://api.github.com/users/ryansb/followers","following_url":"https://api.github.com/users/ryansb/following{/other_user}","gists_url":"https://api.github.com/users/ryansb/gists{/gist_id}","starred_url":"https://api.github.com/users/ryansb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryansb/subscriptions","organizations_url":"https://api.github.com/users/ryansb/orgs","repos_url":"https://api.github.com/users/ryansb/repos","events_url":"https://api.github.com/users/ryansb/events{/privacy}","received_events_url":"https://api.github.com/users/ryansb/received_events","type":"User","site_admin":false},"assignees":[{"login":"ryansb","id":636610,"avatar_url":"https://avatars.githubusercontent.com/u/636610?v=3","gravatar_id":"","url":"https://api.github.com/users/ryansb","html_url":"https://github.com/ryansb","followers_url":"https://api.github.com/users/ryansb/followers","following_url":"https://api.github.com/users/ryansb/following{/other_user}","gists_url":"https://api.github.com/users/ryansb/gists{/gist_id}","starred_url":"https://api.github.com/users/ryansb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryansb/subscriptions","organizations_url":"https://api.github.com/users/ryansb/orgs","repos_url":"https://api.github.com/users/ryansb/repos","events_url":"https://api.github.com/users/ryansb/events{/privacy}","received_events_url":"https://api.github.com/users/ryansb/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/16628/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/16628/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/16628/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/b9e0d109efc3afb29ba0bb5417225a908b1fe375","head":{"label":"s-hertel:API_bugfix","ref":"API_bugfix","sha":"b9e0d109efc3afb29ba0bb5417225a908b1fe375","user":{"login":"s-hertel","id":19572925,"avatar_url":"https://avatars.githubusercontent.com/u/19572925?v=3","gravatar_id":"","url":"https://api.github.com/users/s-hertel","html_url":"https://github.com/s-hertel","followers_url":"https://api.github.com/users/s-hertel/followers","following_url":"https://api.github.com/users/s-hertel/following{/other_user}","gists_url":"https://api.github.com/users/s-hertel/gists{/gist_id}","starred_url":"https://api.github.com/users/s-hertel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-hertel/subscriptions","organizations_url":"https://api.github.com/users/s-hertel/orgs","repos_url":"https://api.github.com/users/s-hertel/repos","events_url":"https://api.github.com/users/s-hertel/events{/privacy}","received_events_url":"https://api.github.com/users/s-hertel/received_events","type":"User","site_admin":false},"repo":{"id":60099782,"name":"ansible","full_name":"s-hertel/ansible","owner":{"login":"s-hertel","id":19572925,"avatar_url":"https://avatars.githubusercontent.com/u/19572925?v=3","gravatar_id":"","url":"https://api.github.com/users/s-hertel","html_url":"https://github.com/s-hertel","followers_url":"https://api.github.com/users/s-hertel/followers","following_url":"https://api.github.com/users/s-hertel/following{/other_user}","gists_url":"https://api.github.com/users/s-hertel/gists{/gist_id}","starred_url":"https://api.github.com/users/s-hertel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-hertel/subscriptions","organizations_url":"https://api.github.com/users/s-hertel/orgs","repos_url":"https://api.github.com/users/s-hertel/repos","events_url":"https://api.github.com/users/s-hertel/events{/privacy}","received_events_url":"https://api.github.com/users/s-hertel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s-hertel/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":true,"url":"https://api.github.com/repos/s-hertel/ansible","forks_url":"https://api.github.com/repos/s-hertel/ansible/forks","keys_url":"https://api.github.com/repos/s-hertel/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s-hertel/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s-hertel/ansible/teams","hooks_url":"https://api.github.com/repos/s-hertel/ansible/hooks","issue_events_url":"https://api.github.com/repos/s-hertel/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/s-hertel/ansible/events","assignees_url":"https://api.github.com/repos/s-hertel/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/s-hertel/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/s-hertel/ansible/tags","blobs_url":"https://api.github.com/repos/s-hertel/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s-hertel/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s-hertel/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/s-hertel/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s-hertel/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/s-hertel/ansible/languages","stargazers_url":"https://api.github.com/repos/s-hertel/ansible/stargazers","contributors_url":"https://api.github.com/repos/s-hertel/ansible/contributors","subscribers_url":"https://api.github.com/repos/s-hertel/ansible/subscribers","subscription_url":"https://api.github.com/repos/s-hertel/ansible/subscription","commits_url":"https://api.github.com/repos/s-hertel/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/s-hertel/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/s-hertel/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/s-hertel/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/s-hertel/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/s-hertel/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s-hertel/ansible/merges","archive_url":"https://api.github.com/repos/s-hertel/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s-hertel/ansible/downloads","issues_url":"https://api.github.com/repos/s-hertel/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/s-hertel/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/s-hertel/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/s-hertel/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s-hertel/ansible/labels{/name}","releases_url":"https://api.github.com/repos/s-hertel/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/s-hertel/ansible/deployments","created_at":"2016-05-31T15:07:40Z","updated_at":"2016-05-31T15:07:48Z","pushed_at":"2016-07-14T19:38:48Z","git_url":"git://github.com/s-hertel/ansible.git","ssh_url":"git@github.com:s-hertel/ansible.git","clone_url":"https://github.com/s-hertel/ansible.git","svn_url":"https://github.com/s-hertel/ansible","homepage":"http://ansible.com/","size":37074,"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":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"906dc99c64772cda28ac747bd83b9cdf5d8984d7","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2016-07-21T17:53:54Z","pushed_at":"2016-07-21T18:04:26Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":62286,"stargazers_count":17936,"watchers_count":17936,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5426,"mirror_url":null,"open_issues_count":1468,"forks":5426,"open_issues":1468,"watchers":17936,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/16628"},"html":{"href":"https://github.com/ansible/ansible/pull/16628"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/16628"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/16628/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/16628/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/16628/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/b9e0d109efc3afb29ba0bb5417225a908b1fe375"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"commits":2,"additions":1,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"ryansb"}}