Giter Club home page Giter Club logo

py-gocd's People

Contributors

gaqzi avatar henriquegemignani avatar jlyheden avatar leonardehrenfried 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

Watchers

 avatar  avatar  avatar  avatar

py-gocd's Issues

Pause fails silently if user is not authorized

If you call pipeline.pause(), but the request fails because your current user is not authorized for such request, the current behavior is to return a a request object that contains the error response.

Wouldn't it make more sense to raise an Exception in this case?

CI

Please provide a new CI since snap-ci is no more. Or publish the snap-ci configuration so one can work on a PR for a travis CI setup.

Using gocd python library with correct credentials getting status code 401

i have a script using gocd python module to connect to goserver and get pipeline status, it was working fine on GOCD 16.x but when i upgraded to 18.3 it always throwing 401 with correct credentials. can you help me on this.

from gocd import Server
server_connection = Server("http://localhost:8153", user = "abc", password = "Enp1")
a = server_connection.pipeline("Test1")
b = a.history()
print b.status_code

not able to create a pipeline

I am using server.post to create a new pipeline bit i am getting error HTTP Error 422: Unprocessable Entity
any help on this

Thanks in advance

pipeline.history returns an Exception ssl.SSLError

Was followoning example stapes pipeline.history returns an Exception
python3.6
gocd version 17.3.0

> from gocd import Server
> 
> server = Server('https://gocd.XXX.com', user='XXX', password='XXX')
> pipeline = server.pipeline('test-pipe')
> 
> response = pipeline.history()
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
    server_hostname=server_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket
    _context=self, _session=session)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in __init__
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake
    self._sslobj.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/natalieserebryakova/gitVevo/pipeline_convertor_v1/convertor.py", line 6, in <module>
    response = pipeline.history()
  File "/Users/natalieserebryakova/.virtualenvs/pipe/lib/python3.6/site-packages/gocd/api/pipeline.py", line 42, in history
    return self._get('/history/{offset:d}'.format(offset=offset or 0))
  File "/Users/natalieserebryakova/.virtualenvs/pipe/lib/python3.6/site-packages/gocd/api/endpoint.py", line 51, in _get
    return self._request(path, ok_status=ok_status, headers=headers)
  File "/Users/natalieserebryakova/.virtualenvs/pipe/lib/python3.6/site-packages/gocd/api/endpoint.py", line 64, in _request
    method=method,
  File "/Users/natalieserebryakova/.virtualenvs/pipe/lib/python3.6/site-packages/gocd/server.py", line 155, in request
    response = urlopen(self._request(path, data=data, headers=headers, method=method))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>

This library does not work with GoCD 18.3.0

I am getting this exception, as though the headers are not being retrieved from the api. Another issue has been raise that speaks to 401 errors. The reason is that bool(response) is always False.

File "gocdAdmin.py", line 58, in
pipeGroups = getPipelines()
File "gocdAdmin.py", line 17, in getPipelines
data = gocdMan.pipelineGroups()
File "./lib/gocdManage.py", line 39, in pipelineGroups
return response.is_ok, response.body
File "/Library/Python/2.7/site-packages/gocd/api/response.py", line 97, in payload
if self.is_json:
File "/Library/Python/2.7/site-packages/gocd/api/response.py", line 67, in is_json
return (self.content_type.startswith('application/json') or
AttributeError: 'bool' object has no attribute 'startswith'

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.