Skip to content

Conversation

@datasearchninja
Copy link
Contributor

As per support Case #488821, DVPL-7118, DEVC-1

In a generating command using SCP2 (chunked = true), commands are unexpectedly distributed

#!/usr/bin/env python

import sys
import time
import socket

from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators

@configuration(
distributed=False
)
class distfalse(GeneratingCommand):
def generate(self):
yield {'_time': time.time(), '_raw': 'This ran on ' + socket.gethostname()}
self.flush()

dispatch(distfalse, sys.argv, sys.stdin, sys.stdout, name)

Copy link
Contributor

@dan1 dan1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change
...
line 149
[('type', 'streaming')])
...
line 168
[('required_fields', ['field_1', 'field_2', 'field_3']), ('type', 'stateful')])

self.assertEqual(
[(name, value) for name, value in command.configuration.iteritems()],
[('generating', True), ('type', 'streaming')])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change this to

[('generating', True), ('type', 'stateful')])

to get the test to pass.

self.assertIs(command.configuration.distributed, False)
self.assertIs(command.configuration.generating, True)
self.assertEqual(command.configuration.type, 'streaming')
self.assertEqual(command.configuration.type, 'stateful')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to set this back to get the test to pass.
self.assertEqual(command.configuration.type, 'streaming')

@dan1
Copy link
Contributor

dan1 commented Jul 31, 2017

disttrue_no_fix

@dan1
Copy link
Contributor

dan1 commented Jul 31, 2017

disttrue_fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants