{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/17989","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/17989/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/17989/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/17989/events","html_url":"https://github.com/ansible/ansible/pull/17989","id":182606598,"number":17989,"title":"Making the ANSI escape regexes configurable in the Shell class","user":{"login":"woody77","id":17480512,"avatar_url":"https://avatars0.githubusercontent.com/u/17480512?v=4","gravatar_id":"","url":"https://api.github.com/users/woody77","html_url":"https://github.com/woody77","followers_url":"https://api.github.com/users/woody77/followers","following_url":"https://api.github.com/users/woody77/following{/other_user}","gists_url":"https://api.github.com/users/woody77/gists{/gist_id}","starred_url":"https://api.github.com/users/woody77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woody77/subscriptions","organizations_url":"https://api.github.com/users/woody77/orgs","repos_url":"https://api.github.com/users/woody77/repos","events_url":"https://api.github.com/users/woody77/events{/privacy}","received_events_url":"https://api.github.com/users/woody77/received_events","type":"User","site_admin":false},"labels":[{"id":454885231,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.3","name":"affects_2.3","color":"5319e7","default":false},{"id":499635167,"url":"https://api.github.com/repos/ansible/ansible/labels/c:module_utils/","name":"c:module_utils/","color":"b60205","default":false},{"id":48457821,"url":"https://api.github.com/repos/ansible/ansible/labels/feature_pull_request","name":"feature_pull_request","color":"006b75","default":false},{"id":512427836,"url":"https://api.github.com/repos/ansible/ansible/labels/module_util","name":"module_util","color":"ededed","default":false},{"id":231201931,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_rebase","name":"needs_rebase","color":"eb6420","default":false},{"id":61436281,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_revision","name":"needs_revision","color":"eb6450","default":false},{"id":581543918,"url":"https://api.github.com/repos/ansible/ansible/labels/stale_ci","name":"stale_ci","color":"fef2c0","default":false},{"id":636352796,"url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-12T19:01:57Z","updated_at":"2017-07-25T19:08:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/17989","html_url":"https://github.com/ansible/ansible/pull/17989","diff_url":"https://github.com/ansible/ansible/pull/17989.diff","patch_url":"https://github.com/ansible/ansible/pull/17989.patch"},"body":"##### ISSUE TYPE\n- Feature Pull Request\n##### COMPONENT NAME\n\nShell\n##### ANSIBLE VERSION\n\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\n\n```\nansible 2.3.0 (shell_ansi_escape_fix a616dcbe1a) last updated 2016/10/12 11:54:17 (GMT -700)\n  lib/ansible/modules/core: (detached HEAD b4f6a25195) last updated 2016/10/11 11:18:35 (GMT -700)\n  lib/ansible/modules/extras: (detached HEAD 734aa8f8e9) last updated 2016/10/11 11:18:40 (GMT -700)\n  config file = \n  configured module search path = Default w/o overrides\n```\n##### SUMMARY\n\nThe module_utils Shell class uses a hardcoded set of regexes to filter out ansi color sequences and terminal escape codes.  For using the Shell with some network appliances, this set of regexes needs to be overridden (or expanded).\n\nThis change allows a CliBase subclass to override the ansi escape regexes in the same manner that it uses to provide the prompt and errors with CLI_PROMPTS_RE and CLI_ERRORS_RE.  This checks for a CLI_ANSI_RE, and if provided, uses that instead of the default ANSI_RE for sanitizing lines read from the remote shell.\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/317840659","html_url":"https://github.com/ansible/ansible/pull/17989#issuecomment-317840659","issue_url":"https://api.github.com/repos/ansible/ansible/issues/17989","id":317840659,"user":{"login":"abadger","id":209242,"avatar_url":"https://avatars2.githubusercontent.com/u/209242?v=4","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"created_at":"2017-07-25T19:08:12Z","updated_at":"2017-07-25T19:08:12Z","body":"We took a look at this among a small group in today's meeting and weren't sure if this was the right API for doing ths.  We thought that perhaps overriding the split method or passing a method into the constructor rather than a regex might make more sense.  But we were limited in evaluating what would be appropriate by not knowing how this is intended to be used.  We have here the ability to override the Shell() constructor but nothing that's calling the constructor with overridden values.  So we're not seeing the complete picture and knowing what the API should look like to accommodate that.\r\n\r\nCould you give us some more information about how this would be called?\r\n\r\nneeds_info"}}
{"actor":{"display_login":"abadger"}}