Giter Club home page Giter Club logo

jumpserver-python-sdk's People

Contributors

baijiangjie avatar dbug-dk avatar ibuler avatar liuzheng avatar salixleaf avatar zabbixfan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jumpserver-python-sdk's Issues

怎么用呢

Python版本:2.7.10

安装

pip install jumpserver-python-sdk==0.0.53

然后按照Git上的方法测试

>>> from jms import UserService
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name UserService

试了其他版本也不行,什么情况

Passing code review

Hello,

I was just passing by and discovered these lines:

        except (requests.ConnectionError, requests.ConnectTimeout) as e:
            msg = "Connect endpoint {} error: {}".format(self.endpoint, e)
            logger.error(msg)
            raise RequestError(msg)

I just wanted to let you know that you can use from which allows exception chaining with a customer exception. Essentially allowing you to do this:

class HttpError(Exception):
    """Base class for all HTTP exceptions"""

class EndpointError(Exception):
    pass

        except (requests.ConnectionError, requests.ConnectTimeout) as e:
            raise EndpointError(f"Connect endpoint for {self.endpoint}") from e

And catch it from a higher layer.

正则匹配的一个细节问题

self.ps1_pattern = re.compile(r'^\[?.*@.*\]?[\$#]\s|mysql>\s')

前面不应该加r, 参考:

The solution is to use Python’s raw string notation for regular expression patterns; backslashes are not handled in any special way in a string literal prefixed with 'r'. So r"\n" is a two-character string containing '' and 'n', while "\n" is a one-character string containing a newline. Usually patterns will be expressed in Python code using this raw string notation.

https://docs.python.org/3.6/library/re.html

[Question] 升级依赖版本

请描述您的问题.
项目中同时使用了python-redmine和jumpserver-python-sdk,都使用了requests模块,但jumpserver对requests的版本固定在2.22.0,导致安装时出现依赖冲突。
请问可以麻烦官网升级一下依赖版本吗?

    jenkinsapi 0.3.11 depends on requests>=2.3.0
    jumpserver-python-sdk 0.0.71 depends on requests==2.22.0
    python-gitlab 2.5.0 depends on requests>=2.22.0
    python-redmine 2.3.0 depends on requests>=2.23.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

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.