Open pylSER opened 5 years ago
By the way, one of the host in iplist
is '127.0.0.1'
No'127.0.0.1',
no problem.
I don't see an error on your side, nor one on Suitable's. I tried your script on some of my own hosts and the results are correct (some 1s, some 0s, for a folder that only exists on some hosts).
You can try and pass verbosity='info'
to the Api class constructor and wade through the heaps of log output to find out if something is wrong. You can also double check your test call by just using ssh:
ssh foo test -d /foo/bar && echo 'exists' || echo 'missing'
Because ultimately that's what happens behind the scenes.
Oh also, can you try to instantiate the api with Api(connection='smart')
. You're saying that without 127.0.0.1 there's no problem, so maybe there's an issue with how Suitable sets the connection if not specifically configured.
HI 'Moss',
After applying connection='smart'
, I found the error: suitable.errors.UnreachableError: 127.0.0.1 could not be reached
And I found ssh root@127.0.0.1
on my machine requires password.
So it is basically my problem, but without applying connection='smart'
, all res code would be 0 and there will be no exceptions, which is not intuitive, isn't it?
Definitely not, I'll edit the title of this and leave it open as a bug.
HI, I am using
python 3.7.4 suitable = "^0.16.0" ansible 2.8.5
And I found that the return code is not correct when there are multi hosts:
say I would like to check if a directory exists on every host:
Am I using it in a wrong manner? Or it is a bug?