pepper icon indicating copy to clipboard operation
pepper copied to clipboard

--fail-if-incomplete causes 'TypeError: string indices must be integers'

Open zzzuzik opened this issue 7 years ago • 10 comments

v.0.7.5 params: '--fail-if-incomplete', '--client', 'local_async', '*', 'test.ping'

outputs:

"{vm1: True}"
"{vm2: True}"
"{vm3: True}"
"{Failed: []}"

And immediately fails with: Uncaught error (Exception): string indices must be integers Failes in

__call__
    return PepperRetcode().validate(self.cli.options, json.loads(result)['return'])

zzzuzik avatar Dec 20 '18 22:12 zzzuzik

basically, you have to skip 'Failed': [] in validation

zzzuzik avatar Dec 20 '18 22:12 zzzuzik

Actually, I belief, that the entire code for poll_for_returns for local_async is broken or I have an extreme bad luck. I spent the whole day fighting timeouts against 2017.7.x and 2018.3.x Here in cli.py: https://github.com/saltstack/pepper/blob/8d6f5bfd71f2412e3ca6904c25044e090b42ba2b/pepper/cli.py#L579 it compares these data: [u'outputter', u'data'] vs actual names of minions [u'vm1', u'vm2', u'vm3'] which eventually ends up with a timeout failure, error code 1

zzzuzik avatar Dec 21 '18 23:12 zzzuzik

@zzzuzik are you going to PR your fixes? Issue indeed exists.

andrii-rymar avatar Feb 04 '19 13:02 andrii-rymar

Yes, can you please submit a PR, and possibly a test for this?

Thanks, Daniel

gtmanfred avatar Feb 08 '19 16:02 gtmanfred

Am also facing the same issue

]# pepper --client local_async '*' test.ping -o json --fail-if-incomplete
string indices must be integers
Uncaught Pepper error (increase verbosity for the full traceback).
# pepper --version
0.7.5

Is there a fix available? If so can I have the fixed code to test the same please.

kk21986 avatar Jul 03 '19 08:07 kk21986

@kk21986 can you check if develop fixes these issues, and if it does, i will get a release out today.

gtmanfred avatar Jul 03 '19 13:07 gtmanfred

@gtmanfred If you don't mind can you provide me the link to download the develop release?

kk21986 avatar Jul 03 '19 13:07 kk21986

there is no release, just pip install the develop branch from git.

gtmanfred avatar Jul 03 '19 14:07 gtmanfred

It worked. Thanks!

kk21986 avatar Jul 03 '19 14:07 kk21986

Cool, i will try and get a release out today.

gtmanfred avatar Jul 03 '19 14:07 gtmanfred