Giter Club home page Giter Club logo

Comments (11)

diyan avatar diyan commented on August 21, 2024

@cchurch I did a code review and in general don't see any major issues with style, naming and general strucutre.

Maybe only one thing I would really would like to change is old stype string formatting into str.format

from pywinrm.

pdunnigan avatar pdunnigan commented on August 21, 2024

I am for switching to requests. I agree with the principal that the less third party modules the better. However requests makes sense.

In our company all new code we do uses requests and old code gets cut over as needed.

On Nov 22, 2014, at 3:09 PM, Alexey Diyan [email protected] wrote:

Below is email that I've got from @cchurch.

I'm not entirely sure what approach we should follow - try to stick with Python stdlib or use requests.

On the one hand we may keep dependencies as less as possible and may even consider to concatenate all sources into single super-module like I saw in defnull/bottle and amoffat/sh.

It could be very convenient for Linux system administrators just do a wget/curl and start using this library at almost any Linux box right away.

On the other hand we may start to use super popular library that everyone knows which will make some things for us much simpler. Code will be simpler than now and we will have less warries on Python 2/3 compatibility at transport level.

I would happy to hear any opinions, especially from people thad did contributions () .

@cchurch:
I've taken a shot at rewriting the transport class to use requests (and requests-kerberos and a modified copy of requests-ntlm) for the following reasons:

Keeping the connection alive to avoid reconnecting or re-authenticating for each message
Adding support for NTLM authentication
Trying multiple authentication schemes based on what the server supports (e.g. trying kerberos but falling back to NTLM or basic)
See https://github.com/cchurch/pywinrm/blob/transport-refactor/winrm/requests_transport.py

It works for me but hasn't been extensively tested yet, doesn't fully implement certificate auth, etc.

I would be interested in your feedback and comments - do you think you'd be interested in including these changes in the project (with additional cleanup and tests)?


Reply to this email directly or view it on GitHub.

from pywinrm.

bjtucker avatar bjtucker commented on August 21, 2024

I'd really love to see this switched to requests. Requests is clean and easy to work with. NTLM authentication for free would be a big plus for free.

from pywinrm.

diyan avatar diyan commented on August 21, 2024

Status update.

I took one day off at my job and spent some time on this.

If anyone interested, all changes are here - https://github.com/diyan/pywinrm/commits/requests

Note that code is mostly broken, so please don't waste your time on sending bug reports.

Next steps would be:

  • prepare a set of Dockerfiles with all versions of Python and at least Ubuntu/CentOS/Arch
  • fix failed build on Travis CI
  • reformat all code into 80 column layout
  • try fix majority of issues reported by pytest_pep8
  • integration testing

from pywinrm.

diyan avatar diyan commented on August 21, 2024

Update.

  • Managed to get pywinrm/requests working with Basic auth
  • Introduce BasicAuthDisabledError and InvalidCredentialsError instead of just HTTP 401 error
  • Added more detailed tutorial on how to setup WinRM client and server

from pywinrm.

cchurch avatar cchurch commented on August 21, 2024

@diyan Thanks for keeping this one moving forward!

from pywinrm.

kgriffs avatar kgriffs commented on August 21, 2024

@diyan I'd also like to see this happen. We are going to be using pywinrm at Rackspace and I generally trust urllib3 (and Requests) more than urllib2. Taking the dependencies is no problem for us, at least.

Is there anything I can help with?

from pywinrm.

andrewpwade avatar andrewpwade commented on August 21, 2024

Using the requests branch solved an issue I was experiencing with 100s of connections sat in TIME_WAIT and frequent "Connection Refused" errors from pywinrm/ansible. Was that a coincdence, or actively fixed in the changes?

(I got it working by copying the winrm.py connection class from Ansible in to a directory specified by the ansible connection_plugins config option, and just fixed the name of the winrm exceptions)

That's a blocker to me using ansible in production with Windows, so I'm interested in seeing requests making it to master.

from pywinrm.

kgriffs avatar kgriffs commented on August 21, 2024

@diyan Do you have an estimate for when this will land?

from pywinrm.

karniemi avatar karniemi commented on August 21, 2024

Yep,

Short story:also waiting for this to land.

Long story: I am facing a problem where our CI runs fail sporadically with "Kerberos-based authentication was failed"-messages . We tried all sorts of "kerberos fixes" found via ggling -but now that I read the source of pywinrm...it seems that all HTTPError&URLError exceptions are pointing the finger at kerberos. So the wrong error messages hinted us in the wrong direction, and actually seems our win-VM replies with code 500(maybe due to overload of some sort). Then found this branch and the issues that are waiting to get solved by it.

from pywinrm.

jborean93 avatar jborean93 commented on August 21, 2024

pywinrm has switched to requests a few releases ago, closing this issue.

from pywinrm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.