IAbstract IAbstract - 4 months ago 8
Python Question

Using Salt's LocalClient, how to achieve same results or specify '-v' arg in test.ping command?

Using the CLI, I can enter the following:


salt '*' test.ping -v


The resulting output is as follows:


minion_A:

True

minion_B:

True

minion_C:

True

minion_D:

Minion did not return


How do I get the same results using the
LocalClient
?
This is what I'm currently attempting and only returns the minions with a response of
True
:

self.localClient.cmd('*', 'test.ping', ['-v'])


Update:

Based on an indication that there could be a bug with
arg
tuples in the command, I have also tried the following:

args = ('-v',)
return self.localClient.cmd('*', 'test.ping', arg=args)


...sadly, still not successful

Answer

The best I could do was to execute from the localClient a test.ping.

If the response is {} I assume a False return from salt-master. Otherwise, a True is received.

Comments