{"action":"opened","number":1920,"pull_request":{"url":"https://api.github.com/repos/GeoNode/geonode/pulls/1920","id":27422631,"html_url":"https://github.com/GeoNode/geonode/pull/1920","diff_url":"https://github.com/GeoNode/geonode/pull/1920.diff","patch_url":"https://github.com/GeoNode/geonode/pull/1920.patch","issue_url":"https://api.github.com/repos/GeoNode/geonode/issues/1920","number":1920,"state":"open","locked":false,"title":"Checks if /dev/null actually exists, and if not, reset it to something Windows understands","user":{"login":"george-silva","id":863039,"avatar_url":"https://avatars.githubusercontent.com/u/863039?v=3","gravatar_id":"","url":"https://api.github.com/users/george-silva","html_url":"https://github.com/george-silva","followers_url":"https://api.github.com/users/george-silva/followers","following_url":"https://api.github.com/users/george-silva/following{/other_user}","gists_url":"https://api.github.com/users/george-silva/gists{/gist_id}","starred_url":"https://api.github.com/users/george-silva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/george-silva/subscriptions","organizations_url":"https://api.github.com/users/george-silva/orgs","repos_url":"https://api.github.com/users/george-silva/repos","events_url":"https://api.github.com/users/george-silva/events{/privacy}","received_events_url":"https://api.github.com/users/george-silva/received_events","type":"User","site_admin":false},"body":"This is a simple patch to solve bug issue #1919.\r\n\r\nThe change is simple. I kept the things that check Java support the same, but now we do not rely on the behavior of java being configured to set the loggernullpath. In a test I made with a Windows Server 2008, ```java -version``` worked, and by consequence, loggernullpath was still ```/dev/null```, causing ```paver start``` to fail, when we could not find that filestream.\r\n\r\nNow, we just check ```os.devnull```. If it's equals to ```nul```, it means we are on Windows. I did not wanted to change line 344, that configures loggernullpath to be the output of ```os.devnull``` because I'm not aware of the consequences this might have on Mac OSX. So, this could be further optimized as (if someone can guarantee that it will work for Mac OSX - Linux I know it will work):\r\n\r\n```python\r\n# function start_geoserver\r\n# ...\r\nwith pushd(data_dir):\r\n        javapath = \"java\"\r\n        loggernullpath = os.devnull\r\n\r\n        # checking if our loggernullpath exists and if not, reset it to something manageable\r\n        if loggernullpath == \"nul\":\r\n            open(\"../../downloaded/null.txt\", 'w+').close()\r\n            loggernullpath = \"../../downloaded/null.txt\"\r\n\r\n        try:\r\n            sh(('java -version'))\r\n        except:\r\n            if not options.get('java_path', None):\r\n                print \"Paver cannot find java in the Windows Environment.  Please provide the --java_path flag with your full path to java.exe e.g. --java_path=C:/path/to/java/bin/java.exe\"\r\n                sys.exit(1)\r\n            # if there are spaces\r\n            javapath = 'START /B \"\" \"' + options['java_path'] + '\"'\r\n\r\n        sh((\r\n            '%(javapath)s -Xmx512m -XX:MaxPermSize=256m'\r\n            ' -DGEOSERVER_DATA_DIR=%(data_dir)s'\r\n            # workaround for JAI sealed jar issue and jetty classloader\r\n            ' -Dorg.eclipse.jetty.server.webapp.parentLoaderPriority=true'\r\n            ' -jar %(jetty_runner)s'\r\n            ' --log %(log_file)s'\r\n            ' %(config)s'\r\n            ' > %(loggernullpath)s &' % locals()\r\n        ))\r\n# ...\r\n```\r\n\r\nThat's pretty much it. I'm not sure how we can test this script. If anyone can point me to the right direction, I can create the UT.","created_at":"2015-01-15T11:44:21Z","updated_at":"2015-01-15T11:44:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GeoNode/geonode/pulls/1920/commits","review_comments_url":"https://api.github.com/repos/GeoNode/geonode/pulls/1920/comments","review_comment_url":"https://api.github.com/repos/GeoNode/geonode/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GeoNode/geonode/issues/1920/comments","statuses_url":"https://api.github.com/repos/GeoNode/geonode/statuses/82fe61b1849f741f7993c9818dc3fd1ee287bc08","head":{"label":"sigma-geosistemas:master","ref":"master","sha":"82fe61b1849f741f7993c9818dc3fd1ee287bc08","user":{"login":"sigma-geosistemas","id":2894510,"avatar_url":"https://avatars.githubusercontent.com/u/2894510?v=3","gravatar_id":"","url":"https://api.github.com/users/sigma-geosistemas","html_url":"https://github.com/sigma-geosistemas","followers_url":"https://api.github.com/users/sigma-geosistemas/followers","following_url":"https://api.github.com/users/sigma-geosistemas/following{/other_user}","gists_url":"https://api.github.com/users/sigma-geosistemas/gists{/gist_id}","starred_url":"https://api.github.com/users/sigma-geosistemas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigma-geosistemas/subscriptions","organizations_url":"https://api.github.com/users/sigma-geosistemas/orgs","repos_url":"https://api.github.com/users/sigma-geosistemas/repos","events_url":"https://api.github.com/users/sigma-geosistemas/events{/privacy}","received_events_url":"https://api.github.com/users/sigma-geosistemas/received_events","type":"Organization","site_admin":false},"repo":{"id":29294055,"name":"geonode","full_name":"sigma-geosistemas/geonode","owner":{"login":"sigma-geosistemas","id":2894510,"avatar_url":"https://avatars.githubusercontent.com/u/2894510?v=3","gravatar_id":"","url":"https://api.github.com/users/sigma-geosistemas","html_url":"https://github.com/sigma-geosistemas","followers_url":"https://api.github.com/users/sigma-geosistemas/followers","following_url":"https://api.github.com/users/sigma-geosistemas/following{/other_user}","gists_url":"https://api.github.com/users/sigma-geosistemas/gists{/gist_id}","starred_url":"https://api.github.com/users/sigma-geosistemas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigma-geosistemas/subscriptions","organizations_url":"https://api.github.com/users/sigma-geosistemas/orgs","repos_url":"https://api.github.com/users/sigma-geosistemas/repos","events_url":"https://api.github.com/users/sigma-geosistemas/events{/privacy}","received_events_url":"https://api.github.com/users/sigma-geosistemas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sigma-geosistemas/geonode","description":"GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.","fork":true,"url":"https://api.github.com/repos/sigma-geosistemas/geonode","forks_url":"https://api.github.com/repos/sigma-geosistemas/geonode/forks","keys_url":"https://api.github.com/repos/sigma-geosistemas/geonode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sigma-geosistemas/geonode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sigma-geosistemas/geonode/teams","hooks_url":"https://api.github.com/repos/sigma-geosistemas/geonode/hooks","issue_events_url":"https://api.github.com/repos/sigma-geosistemas/geonode/issues/events{/number}","events_url":"https://api.github.com/repos/sigma-geosistemas/geonode/events","assignees_url":"https://api.github.com/repos/sigma-geosistemas/geonode/assignees{/user}","branches_url":"https://api.github.com/repos/sigma-geosistemas/geonode/branches{/branch}","tags_url":"https://api.github.com/repos/sigma-geosistemas/geonode/tags","blobs_url":"https://api.github.com/repos/sigma-geosistemas/geonode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sigma-geosistemas/geonode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sigma-geosistemas/geonode/git/refs{/sha}","trees_url":"https://api.github.com/repos/sigma-geosistemas/geonode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sigma-geosistemas/geonode/statuses/{sha}","languages_url":"https://api.github.com/repos/sigma-geosistemas/geonode/languages","stargazers_url":"https://api.github.com/repos/sigma-geosistemas/geonode/stargazers","contributors_url":"https://api.github.com/repos/sigma-geosistemas/geonode/contributors","subscribers_url":"https://api.github.com/repos/sigma-geosistemas/geonode/subscribers","subscription_url":"https://api.github.com/repos/sigma-geosistemas/geonode/subscription","commits_url":"https://api.github.com/repos/sigma-geosistemas/geonode/commits{/sha}","git_commits_url":"https://api.github.com/repos/sigma-geosistemas/geonode/git/commits{/sha}","comments_url":"https://api.github.com/repos/sigma-geosistemas/geonode/comments{/number}","issue_comment_url":"https://api.github.com/repos/sigma-geosistemas/geonode/issues/comments/{number}","contents_url":"https://api.github.com/repos/sigma-geosistemas/geonode/contents/{+path}","compare_url":"https://api.github.com/repos/sigma-geosistemas/geonode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sigma-geosistemas/geonode/merges","archive_url":"https://api.github.com/repos/sigma-geosistemas/geonode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sigma-geosistemas/geonode/downloads","issues_url":"https://api.github.com/repos/sigma-geosistemas/geonode/issues{/number}","pulls_url":"https://api.github.com/repos/sigma-geosistemas/geonode/pulls{/number}","milestones_url":"https://api.github.com/repos/sigma-geosistemas/geonode/milestones{/number}","notifications_url":"https://api.github.com/repos/sigma-geosistemas/geonode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sigma-geosistemas/geonode/labels{/name}","releases_url":"https://api.github.com/repos/sigma-geosistemas/geonode/releases{/id}","created_at":"2015-01-15T11:18:38Z","updated_at":"2015-01-15T11:35:32Z","pushed_at":"2015-01-15T11:35:31Z","git_url":"git://github.com/sigma-geosistemas/geonode.git","ssh_url":"git@github.com:sigma-geosistemas/geonode.git","clone_url":"https://github.com/sigma-geosistemas/geonode.git","svn_url":"https://github.com/sigma-geosistemas/geonode","homepage":"http://geonode.org/","size":96947,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"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":"GeoNode:master","ref":"master","sha":"143a06936307e46f1aca184c3a8945e42264a530","user":{"login":"GeoNode","id":132843,"avatar_url":"https://avatars.githubusercontent.com/u/132843?v=3","gravatar_id":"","url":"https://api.github.com/users/GeoNode","html_url":"https://github.com/GeoNode","followers_url":"https://api.github.com/users/GeoNode/followers","following_url":"https://api.github.com/users/GeoNode/following{/other_user}","gists_url":"https://api.github.com/users/GeoNode/gists{/gist_id}","starred_url":"https://api.github.com/users/GeoNode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeoNode/subscriptions","organizations_url":"https://api.github.com/users/GeoNode/orgs","repos_url":"https://api.github.com/users/GeoNode/repos","events_url":"https://api.github.com/users/GeoNode/events{/privacy}","received_events_url":"https://api.github.com/users/GeoNode/received_events","type":"Organization","site_admin":false},"repo":{"id":701765,"name":"geonode","full_name":"GeoNode/geonode","owner":{"login":"GeoNode","id":132843,"avatar_url":"https://avatars.githubusercontent.com/u/132843?v=3","gravatar_id":"","url":"https://api.github.com/users/GeoNode","html_url":"https://github.com/GeoNode","followers_url":"https://api.github.com/users/GeoNode/followers","following_url":"https://api.github.com/users/GeoNode/following{/other_user}","gists_url":"https://api.github.com/users/GeoNode/gists{/gist_id}","starred_url":"https://api.github.com/users/GeoNode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeoNode/subscriptions","organizations_url":"https://api.github.com/users/GeoNode/orgs","repos_url":"https://api.github.com/users/GeoNode/repos","events_url":"https://api.github.com/users/GeoNode/events{/privacy}","received_events_url":"https://api.github.com/users/GeoNode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GeoNode/geonode","description":"GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.","fork":false,"url":"https://api.github.com/repos/GeoNode/geonode","forks_url":"https://api.github.com/repos/GeoNode/geonode/forks","keys_url":"https://api.github.com/repos/GeoNode/geonode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GeoNode/geonode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GeoNode/geonode/teams","hooks_url":"https://api.github.com/repos/GeoNode/geonode/hooks","issue_events_url":"https://api.github.com/repos/GeoNode/geonode/issues/events{/number}","events_url":"https://api.github.com/repos/GeoNode/geonode/events","assignees_url":"https://api.github.com/repos/GeoNode/geonode/assignees{/user}","branches_url":"https://api.github.com/repos/GeoNode/geonode/branches{/branch}","tags_url":"https://api.github.com/repos/GeoNode/geonode/tags","blobs_url":"https://api.github.com/repos/GeoNode/geonode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GeoNode/geonode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GeoNode/geonode/git/refs{/sha}","trees_url":"https://api.github.com/repos/GeoNode/geonode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GeoNode/geonode/statuses/{sha}","languages_url":"https://api.github.com/repos/GeoNode/geonode/languages","stargazers_url":"https://api.github.com/repos/GeoNode/geonode/stargazers","contributors_url":"https://api.github.com/repos/GeoNode/geonode/contributors","subscribers_url":"https://api.github.com/repos/GeoNode/geonode/subscribers","subscription_url":"https://api.github.com/repos/GeoNode/geonode/subscription","commits_url":"https://api.github.com/repos/GeoNode/geonode/commits{/sha}","git_commits_url":"https://api.github.com/repos/GeoNode/geonode/git/commits{/sha}","comments_url":"https://api.github.com/repos/GeoNode/geonode/comments{/number}","issue_comment_url":"https://api.github.com/repos/GeoNode/geonode/issues/comments/{number}","contents_url":"https://api.github.com/repos/GeoNode/geonode/contents/{+path}","compare_url":"https://api.github.com/repos/GeoNode/geonode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GeoNode/geonode/merges","archive_url":"https://api.github.com/repos/GeoNode/geonode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GeoNode/geonode/downloads","issues_url":"https://api.github.com/repos/GeoNode/geonode/issues{/number}","pulls_url":"https://api.github.com/repos/GeoNode/geonode/pulls{/number}","milestones_url":"https://api.github.com/repos/GeoNode/geonode/milestones{/number}","notifications_url":"https://api.github.com/repos/GeoNode/geonode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GeoNode/geonode/labels{/name}","releases_url":"https://api.github.com/repos/GeoNode/geonode/releases{/id}","created_at":"2010-06-03T18:14:47Z","updated_at":"2015-01-14T14:19:52Z","pushed_at":"2015-01-14T12:14:41Z","git_url":"git://github.com/GeoNode/geonode.git","ssh_url":"git@github.com:GeoNode/geonode.git","clone_url":"https://github.com/GeoNode/geonode.git","svn_url":"https://github.com/GeoNode/geonode","homepage":"http://geonode.org/","size":96947,"stargazers_count":272,"watchers_count":272,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":236,"mirror_url":null,"open_issues_count":263,"forks":236,"open_issues":263,"watchers":272,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GeoNode/geonode/pulls/1920"},"html":{"href":"https://github.com/GeoNode/geonode/pull/1920"},"issue":{"href":"https://api.github.com/repos/GeoNode/geonode/issues/1920"},"comments":{"href":"https://api.github.com/repos/GeoNode/geonode/issues/1920/comments"},"review_comments":{"href":"https://api.github.com/repos/GeoNode/geonode/pulls/1920/comments"},"review_comment":{"href":"https://api.github.com/repos/GeoNode/geonode/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GeoNode/geonode/pulls/1920/commits"},"statuses":{"href":"https://api.github.com/repos/GeoNode/geonode/statuses/82fe61b1849f741f7993c9818dc3fd1ee287bc08"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":6,"deletions":4,"changed_files":1}}