{"action":"created","issue":{"url":"https://api.github.com/repos/pcmanus/ccm/issues/264","labels_url":"https://api.github.com/repos/pcmanus/ccm/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/pcmanus/ccm/issues/264/comments","events_url":"https://api.github.com/repos/pcmanus/ccm/issues/264/events","html_url":"https://github.com/pcmanus/ccm/pull/264","id":68409751,"number":264,"title":"`run_cqlsh` improvements","user":{"login":"mambocab","id":3753769,"avatar_url":"https://avatars.githubusercontent.com/u/3753769?v=3","gravatar_id":"","url":"https://api.github.com/users/mambocab","html_url":"https://github.com/mambocab","followers_url":"https://api.github.com/users/mambocab/followers","following_url":"https://api.github.com/users/mambocab/following{/other_user}","gists_url":"https://api.github.com/users/mambocab/gists{/gist_id}","starred_url":"https://api.github.com/users/mambocab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mambocab/subscriptions","organizations_url":"https://api.github.com/users/mambocab/orgs","repos_url":"https://api.github.com/users/mambocab/repos","events_url":"https://api.github.com/users/mambocab/events{/privacy}","received_events_url":"https://api.github.com/users/mambocab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-14T15:22:11Z","updated_at":"2015-04-14T16:49:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pcmanus/ccm/pulls/264","html_url":"https://github.com/pcmanus/ccm/pull/264","diff_url":"https://github.com/pcmanus/ccm/pull/264.diff","patch_url":"https://github.com/pcmanus/ccm/pull/264.patch"},"body":"Several improvements here:\r\n\r\n- The way `Node.run_cqlsh` split its input led to lots of lines that looked like `';\\n'` getting sent to cqlsh, which leads to confusing syntax errors. This only sends `line + ';'` if `line.strip()` is non-empty.\r\n- If the `show_output` kwarg to `run_cqlsh` is truthy, it prints all output. However, it skipped the first 4 lines. This may have been getting around some property of an old cqlsh, but this is no longer valid.\r\n- Finally, this adds a `return_output` kwarg. If it's truthy, `run_cqlsh` will return cqlsh's output as a string.\r\n\r\nSince `return_output` is a kwarg with a default value at the end of the argument list, this shouldn't change the `run_cqlsh` API; if you just ignore it, it won't affect you.\r\n\r\n I've also tested the combination of these two kwargs and added a basic \"does this thing fall over\" test."},"comment":{"url":"https://api.github.com/repos/pcmanus/ccm/issues/comments/92974971","html_url":"https://github.com/pcmanus/ccm/pull/264#issuecomment-92974971","issue_url":"https://api.github.com/repos/pcmanus/ccm/issues/264","id":92974971,"user":{"login":"ptnapoleon","id":3408144,"avatar_url":"https://avatars.githubusercontent.com/u/3408144?v=3","gravatar_id":"","url":"https://api.github.com/users/ptnapoleon","html_url":"https://github.com/ptnapoleon","followers_url":"https://api.github.com/users/ptnapoleon/followers","following_url":"https://api.github.com/users/ptnapoleon/following{/other_user}","gists_url":"https://api.github.com/users/ptnapoleon/gists{/gist_id}","starred_url":"https://api.github.com/users/ptnapoleon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptnapoleon/subscriptions","organizations_url":"https://api.github.com/users/ptnapoleon/orgs","repos_url":"https://api.github.com/users/ptnapoleon/repos","events_url":"https://api.github.com/users/ptnapoleon/events{/privacy}","received_events_url":"https://api.github.com/users/ptnapoleon/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T16:49:47Z","updated_at":"2015-04-14T16:49:47Z","body":"That's clever. There are some other commands that could probably be cleaned up in the same way. They return the raw `p.stdout` and `p.stderr`, rather than the result of `read()`."}}