Description
* Add new presets: `UNKNOWN`, `BASE64_ENCODE`, `BASE64_DECODE`, `INVALID_JSON`
* Add an optional `data` parameter for formatting response output
Tests
msg = 'blah'
raise PluginException(preset=PluginException.Preset.BASE64_ENCODE, data=msg)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 311, in handle_step
output = self.start_step(input_message['body'], 'action', logger, log_stream, is_test, is_debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 413, in start_step
output = func(params)
File "build/bdist.linux-x86_64/egg/icon_crap/actions/upper/action.py", line 20, in run
data=msg
PluginException: An error occurred during plugin execution!
Unable to base64 encode content due to incorrect padding length. This is likely a programming error, if the issue persists please contact support. Response was: blah
msg = 'blah'
raise PluginException(preset=PluginException.Preset.BASE64_DECODE, data=msg)
Traceback (most recent call last):
File "/usr/local/bin/icon_crap", line 4, in <module>
__import__('pkg_resources').run_script('crap-rapid7-plugin==1.0.0', 'icon_crap')
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 38, in <module>
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 34, in main
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 188, in run
args.func(args)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 138, in run_step
return self.execute_step(is_test=False, is_debug=args.debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 135, in execute_step
raise exception
komand.exceptions.LoggedException: An error occurred during plugin execution!
Unable to base64 decode content due to incorrect padding length. This is likely a programming error, if the issue persists please contact support. Response was: blah
msg = 'Unknown data'
raise PluginException(preset=PluginException.Preset.UNKNOWN, data=msg)
Traceback (most recent call last):
File "/usr/local/bin/icon_crap", line 4, in <module>
__import__('pkg_resources').run_script('crap-rapid7-plugin==1.0.0', 'icon_crap')
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 38, in <module>
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 34, in main
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 188, in run
args.func(args)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 138, in run_step
return self.execute_step(is_test=False, is_debug=args.debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 135, in execute_step
raise exception
komand.exceptions.LoggedException: An error occurred during plugin execution!
Something unexpected occurred. Check the logs and if the issue persists please contact support. Response was: Unknown data
msg = '{ \"asdf\": asdf }'
raise PluginException(preset=PluginException.Preset.UNKNOWN, data=msg)
Traceback (most recent call last):
File "/usr/local/bin/icon_crap", line 4, in <module>
__import__('pkg_resources').run_script('crap-rapid7-plugin==1.0.0', 'icon_crap')
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 38, in <module>
File "/usr/local/lib/python2.7/site-packages/crap_rapid7_plugin-1.0.0-py2.7.egg/EGG-INFO/scripts/icon_crap", line 34, in main
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 188, in run
args.func(args)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 138, in run_step
return self.execute_step(is_test=False, is_debug=args.debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/cli.py", line 135, in execute_step
raise exception
komand.exceptions.LoggedException: An error occurred during plugin execution!
Received an unexpected response from the server. (non-JSON or no response was received). Response was: { "asdf": asdf }
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 311, in handle_step
output = self.start_step(input_message['body'], 'action', logger, log_stream, is_test, is_debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 413, in start_step
output = func(params)
File "build/bdist.linux-x86_64/egg/icon_crap/actions/lower/action.py", line 21, in run
data=msg
PluginException: An error occurred during plugin execution!
Something caused this. I don't have assistance but I have data! Response was: Blah
* Without `data`
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 311, in handle_step
output = self.start_step(input_message['body'], 'action', logger, log_stream, is_test, is_debug)
File "/usr/local/lib/python2.7/site-packages/komand-1.0.1-py2.7.egg/komand/plugin.py", line 413, in start_step
output = func(params)
File "build/bdist.linux-x86_64/egg/icon_crap/actions/split_to_list/action.py", line 19, in run
assistance="I don't have assistance"
PluginException: An error occurred during plugin execution!
Something caused this. I don't have assistance