pepper icon indicating copy to clipboard operation
pepper copied to clipboard

pepper -v and pepper -H don't display anything

Open arthurzenika opened this issue 9 years ago • 13 comments

The --verbose and --debug-http don't display anything.

I've tried adding some logger.debug statements which don't change anything.

Adding some prints are displayed.

            logger.debug('Sending ', postdata)

would be useful.

arthurzenika avatar Jun 16 '15 16:06 arthurzenika

        logger.setLevel(max(logging.ERROR - (self.options.verbose * 10), 1))

seem a bit weird. Could we adopt the same convention as for salt with --log-level all (all|debug|info|warn) etc.

arthurzenika avatar Jun 24 '15 08:06 arthurzenika

I can't reproduce this. What version are you on? What is the full command you're running? What is the expected vs. actual output?

% pepper --debug-http -u http://localhost:8000 '*' test.ping
send: 'POST /login HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 63\r\nConnection: close\r\nAccept: application/json\r\nUser-Agent: Python-urllib/2.7\r\nHost: localhost:8000\r\nX-Requested-With: XMLHttpRequest\r\nContent-Type: application/json\r\n\r\n{"username": "saltdev", "password": "saltdev", "eauth": "auto"}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Length: 198
header: Access-Control-Expose-Headers: GET, POST
header: Vary: Accept-Encoding
header: Server: CherryPy/3.2.4
header: Allow: GET, HEAD, POST
header: Access-Control-Allow-Credentials: true
header: Date: Wed, 24 Jun 2015 19:30:14 GMT
header: Access-Control-Allow-Origin: *
header: X-Auth-Token: 0da8ccc7a05de1389b50364d762f7c96fa982365
header: Content-Type: application/json
header: Set-Cookie: session_id=0da8ccc7a05de1389b50364d762f7c96fa982365; expires=Thu, 25 Jun 2015 05:30:14 GMT; Path=/
header: Connection: close
send: 'POST / HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 80\r\nConnection: close\r\nAccept: application/json\r\nX-Auth-Token: 0da8ccc7a05de1389b50364d762f7c96fa982365\r\nHost: localhost:8000\r\nX-Requested-With: XMLHttpRequest\r\nUser-Agent: Python-urllib/2.7\r\nContent-Type: application/json\r\n\r\n[{"fun": "test.ping", "client": "local_async", "expr_form": "glob", "tgt": "*"}]'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Length: 107
header: Access-Control-Expose-Headers: GET, POST
header: Access-Control-Allow-Credentials: true
header: Vary: Accept-Encoding
header: Server: CherryPy/3.2.4
header: Allow: GET, HEAD, POST
header: Cache-Control: private
header: Date: Wed, 24 Jun 2015 19:30:14 GMT
header: Access-Control-Allow-Origin: *
header: Content-Type: application/json
header: Set-Cookie: session_id=0da8ccc7a05de1389b50364d762f7c96fa982365; expires=Thu, 25 Jun 2015 05:30:14 GMT; Path=/
header: Connection: close
send: 'POST / HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 79\r\nConnection: close\r\nAccept: application/json\r\nX-Auth-Token: 0da8ccc7a05de1389b50364d762f7c96fa982365\r\nHost: localhost:8000\r\nX-Requested-With: XMLHttpRequest\r\nUser-Agent: Python-urllib/2.7\r\nContent-Type: application/json\r\n\r\n[{"fun": "jobs.lookup_jid", "jid": "20150624133014974350", "client": "runner"}]'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Length: 29
header: Access-Control-Expose-Headers: GET, POST
header: Access-Control-Allow-Credentials: true
header: Vary: Accept-Encoding
header: Server: CherryPy/3.2.4
header: Allow: GET, HEAD, POST
header: Cache-Control: private
header: Date: Wed, 24 Jun 2015 19:30:18 GMT
header: Access-Control-Allow-Origin: *
header: Content-Type: application/json
header: Set-Cookie: session_id=0da8ccc7a05de1389b50364d762f7c96fa982365; expires=Thu, 25 Jun 2015 05:30:18 GMT; Path=/
header: Connection: close
{
    "jerry": true
}

whiteinge avatar Jun 24 '15 19:06 whiteinge

$ pepper --version
0.2.0.dev37

I don't have any of the header/send/reply information. Looks nice, I hope we can get it work.

arthurzenika avatar Jun 25 '15 06:06 arthurzenika

That version number looks odd. Related to #39 I'll bet.

whiteinge avatar Jun 25 '15 18:06 whiteinge

I am experiencing the same issue. Using v0.4.1. I get the output of the command, but no debug/http data.

root@53ac749c6d63:/# pepper --version
0.4.1
root@53ac749c6d63:/# pepper -H '*' test.ping
{
    "return": [
        {
            "mongodb-backup-generic-test-i-00a2e54a978f64d21": true,
            "mongodb-generic-test-i-001c928a68509fae0": true,
            "mongodb-generic-test-i-03ca19e8101889f54": true,
            "salt-master": true
        }
    ]
}
root@53ac749c6d63:/# pepper -H '*' test.ping 2>&1
{
    "return": [
        {
            "mongodb-backup-generic-test-i-00a2e54a978f64d21": true,
            "mongodb-generic-test-i-001c928a68509fae0": true,
            "mongodb-generic-test-i-03ca19e8101889f54": true,
            "salt-master": true
        }
    ]
}

rgeyer avatar Dec 29 '16 18:12 rgeyer

I believe this was fixed on the develop branch. Please try on the newly cut 0.5.0 release.

whiteinge avatar Dec 29 '16 22:12 whiteinge

Maybe it is related to #138

ezh avatar Apr 14 '18 16:04 ezh

@rgeyer @arthurlogilab can yall check if the new version has fixed this issue?

Thanks, Daniel

gtmanfred avatar Aug 02 '18 23:08 gtmanfred

Holy resurrected issue batman!

Sadly, I no longer have access to a working saltstack so I can't confirm.

rgeyer avatar Aug 03 '18 18:08 rgeyer

Ok, thanks for responding!

gtmanfred avatar Aug 03 '18 19:08 gtmanfred

@gtmanfred I just tried it with pepper 0.7.1 from PyPI, and it doesn't work.

kyrias avatar Aug 08 '18 14:08 kyrias

And more specifically, it's running under Python 3.6.

kyrias avatar Aug 08 '18 14:08 kyrias

sounds good, i will take a closer look when I have time.

gtmanfred avatar Aug 08 '18 14:08 gtmanfred