| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the username and port are specified when constructing the client,
they will be used instead of attempting to fetch from the ssh config
file.
In this case the full hostname of the server is required, rather
than only the name as listed in the ssh config.
Change-Id: I82b8638d99922c9b40a54a8275ffc085f505696f
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of using select.select() to wait for input, use the methods
provided by paramiko's client channel object.
Read from both stdout and stderr, and send ErrorEvent if anything is
received on stderr.
Ref #1
Fix #12
Change-Id: Ic67392cb9d689a1f457f5d02eb17a5432112a0c0
|
| | |
| |
| |
| |
| |
| | |
Also fix a minor coding style issue.
Change-Id: Ib366a816e5cf979eb94c7ce545d1c87c6c3984c8
|
| | |
| |
| |
| | |
Change-Id: I19e955c3ca7c84600ec89ff24d5c7458202ff609
|
| | |
| |
| |
| |
| |
| |
| |
| | |
The `identityfile` element of the result returned by SSHConfig.lookup()
is a list, not a string, therefore calling `expanduser` on it results
in a crash.
Change-Id: I8673295d66cac9ca3b522867735b1211f0556d21
|
| | |
| |
| |
| | |
Change-Id: I70b9cbea1da20a1434eea39e3d8e85e94357b792
|
| | |
| |
| |
| | |
Change-Id: I72ece72c08ddc6da31c14db35dd84f35d61d39ed
|
| | |
| |
| |
| | |
Change-Id: I3308b44dc1bbfcaa70e38cb4857c2241c551cfa4
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Pass the raw string into the event factory and parse it to a json
object there. If the string is not valid json, generate an error
event.
Add a unit test for handling of invalid json on the event stream.
Change-Id: I209a89fd28c3a594b71443fc106e25d58c5cc1ea
|
| | |
| |
| |
| |
| |
| |
| |
| | |
If an unknown event is received on the event stream, for example if a
new event has been added in a later version of Gerrit, do not raise
an error. Instead, generate an "UnhandledEvent" event.
Change-Id: Ia1902bf4a54883011b7ad3e004f58a2ba8739b21
|
| | |
| |
| |
| |
| |
| |
| |
| | |
If any future versions of Gerrit add data elements that are not
encapsulated by the event class, clients will be able to access them
via the raw json data.
Change-Id: Ia689acb808f9d200f53b86c60f024e865dd12a18
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This gives more meaningful output when doing:
print(event)
and means it's not necessary to use str(event).
Change-Id: I3c1546ab89c481bec24fbc4445ed7f33aa05eff8
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The `exec_command` overrides the method of the same name from the
parent class unnecessarily.
Remove it and call the parent `exec_command` method directly from the
`run_gerrit_command` method.
Change-Id: I977000a372c9b6e9143ca0e740b971a606a83146
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Use an Event(), rather than a boolean, to determine whether or not
the remote is connected.
Protect the connection logic with a Lock().
Change-Id: Ifc5888894a90b7e3a11e21ec3f9bf69f0a7608a8
|
| | |
| |
| |
| |
| |
| |
| |
| | |
select.poll() does not work on all platforms.
Replace it with select.select().
Change-Id: Iadd09127c99b5b47ebc28f6f4e57fcc1eb4c8710
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The initial intention was for these to only be used internally,
and add wrapper methods to be used by clients.
Instead, we now make them public, allowing the API to be used
as a basic REST client before any wrappers are added.
Change-Id: Icfa92125466b9b798ac30fb865d2d15a2892f552
|
| | |
| |
| |
| | |
Change-Id: I8a7557818cd3c207035ef627e6912ee945c083c6
|
| | |
| |
| |
| | |
Change-Id: I9cdb6b7ff2bf6ea20925c5b2eac68ef454a6ea23
|
| | |
| |
| |
| |
| |
| |
| | |
If the username and password are given, pass them to the
request with HTTP digest authentication.
Change-Id: If15628262a4ef6b370c3d0794dbc9ecd3a0be624
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This initial version implements wrappers for GET, PUT, POST
and DELETE requests.
Authentication is not implemented. All requests are sent
anonymously.
Handling of error responses is not implemented.
This change introduces a dependency on python-requests.
Change-Id: I579f9f02be8afbb4e720daf97ca873d77cd54a77
|
| |
|
|
| |
Change-Id: I09fcd52a9eb0f7aab7fa82f276187af6704af899
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the copyright and license headers are in module docstrings, they
appear in the generated API documentation pages and it looks crappy.
Instead, put the headers in regular Python comments. Thus each file
still has the required copyright and license notice, but it is not
included everywhere in the generated documentation.
The documentation still includes an automatically generated copyright
notice at the bottom of each page.
Change-Id: Ibc5f4ca221c0a6de26f04f3b4511d8991e28b663
|
| |
|
|
|
|
|
|
|
|
| |
Documentation is generated in html format into the docs folder.
The idea is that with further commits we can automatically generate
and package the documentation into a zip file that can be published
to the package index.
Change-Id: Ia5719bda59b6224fc05e2021e9054e29990ad22a
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add missing docstrings that the PEP-257 checker did not report.
- Add explicit parameters on `GerritSSHClient.exec_command` method
overridden from `paramiko.SSHClient.exec_command`.
- Disable warning that the `GerritEvent` class does not have a member
named `name`. This member is initialised by the event factory when
a derived class is instantiated.
- Capitalise constant `REQUIRES`.
Change-Id: I8880e061b51e12145ee55e0cd86dab930970cde5
|
| |
|
|
| |
Change-Id: I6bc8d92ed1055959f1c24128b8beace814eaf998
|
| |
|
|
| |
Change-Id: Ie595ac7125323677ad478655c33b21a00302007c
|
| |
|
|
| |
Change-Id: I850978039ca10162a5ae2ab0a4f79374183107ba
|
| |
|
|
|
|
|
|
|
|
| |
We're currently only using the version number in the setup
script, but in future we might need it in other places too.
Define the version number in the module itself and import
it in setup.
Change-Id: Idbf246d3a9777f6de710cb01fa05f8fbf031d192
|
| |
|
|
|
|
|
| |
Include the name of the command that was run in the result
object.
Change-Id: I93c27ed937d27942428f561dc50d84b5ea25591a
|
| |
|
|
|
|
|
|
|
|
| |
Instead of opening the ssh connection in the constructor, only
connect when actually needed.
This improves performance of the unit tests. Running the test
suite now takes less than 1 second rather than 22 seconds.
Change-Id: I03a49d74db8c045740a85201c02c492d175e0d6c
|
| |
|
|
|
|
|
|
| |
When the stream-event command fails, for example due to bad
host name, the result is not initialised. However the code
was accessing the result variable which caused an exception.
Change-Id: I6c649dba447e33733dfaea6e742152277fa7374f
|
| |
|
|
| |
Change-Id: If06f1ea17740a796142db63e7086f80445f4c6e1
|
| |
|
|
|
|
|
| |
Catch socket error raised when connecting to the server over SSH
and raise a GerritError.
Change-Id: I140a26be4bc04ec229d95faaa80b94477cf96645
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Handle exceptions with the syntax:
except Exception as e
rather than:
except Exception, e
Change-Id: I883fdc1db541b9d2699712bfd2bd328261635005
|
| |
|
|
|
|
| |
This reverts commit 42272ffdb1541cf96f13466446e07c24d8e7febb.
Change-Id: Ie00d75579231873db98bc3a84caef408152f3d81
|
| |
|
|
|
|
|
|
| |
Add a new class GerritSSHCommandResult to encapsulate the stdin,
stdout, and stderr streams that are returned from running a
command over SSH.
Change-Id: Ic851c195ac63e530e62198eb7e0af62c2fbd73d5
|
| |
|
|
|
|
|
|
|
| |
In version 0.26 of pylint the message enable/disable options are
changed. Update the configuration to reflect this.
Also remove redundant suppressions.
Change-Id: Ia6e4c6c79cd573dfc91aec53b32c58930fbbde55
|
| |
|
|
|
|
|
|
| |
Only add JSON lines in the results if they contain "project".
Otherwise the "rowCount" line, and anything else, will be included
in the results as an empty Change object.
Change-Id: Ia4de4ed7970c8f5ba87f5e12dd42ff45b459b047
|
| |
|
|
| |
Change-Id: Iadced9142673f1a5f277462bc6d9027db4a53e2d
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Move the functionality to get the Gerrit version from the main
client into the SSH client and reimplement it.
First attempt to get the version from the underlying Paramiko SSH
client. If that fails, fall back to using the `gerrit version`
command as before.
Get and print the version in the example script.
Change-Id: Ia79853f80f898b43c301fcecee61fdfdb75e9811
|
| |
|
|
| |
Change-Id: I283773fb6b68da1878ede9001d18b5b7d0aff569
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handle IOError and ValueError separately from GerritError when
processing the steam. In this case GerritError is raised if
there is a problem adding an event to the queue; it makes no
sense to then try to add an error event on the same queue.
Add separate handling of GerritError when running the gerrit
stream-events command.
Move the creation of the error event out to a utility method.
Change-Id: Iac5aa8db5ad1a444fd0e6217c32d1800f727276e
|
| |
|
|
|
|
|
| |
Also make sure the lock is released when an exception
occurs.
Change-Id: Id4af1d4950f604f47b11fdd7d84f94f769aecd4d
|
| |
|
|
| |
Change-Id: I7ad27a83d5af3eaca7a188e01cbef392c9ff1b6b
|
| |
|
|
|
|
| |
Add a lock around calls to the run_gerrit_command method.
Change-Id: I9429ed880e14a4248b08937969f8faebc2240f79
|
| |
|
|
|
|
|
| |
Handle IOError that can occur when reading from the stream,
and ValueError that can be raised by the JSON parser.
Change-Id: Ic9dc60e048f0f747daf8b34c7b6d8d90c11bb1e0
|
| |
|
|
|
|
|
|
| |
Later the client might have functionality that only works on
certain versions of Gerrit. Store the Gerrit version during
initialisation.
Change-Id: Idcd35baf00d6cd583f6f85b68c4b0a0c3653344b
|
| |
|
|
|
|
|
| |
Add a method that calls `gerrit query` and returns the results as
a list of Change objects.
Change-Id: Ie58a61e569d457c56109e34041e9db95147de91c
|
| |
|
|
| |
Change-Id: I26f1c11223b4271c3e5a74c9333a1f7513c5acab
|
| |
|
|
|
|
|
| |
So it can be reused in query functionality that will be added
later.
Change-Id: I361aaf8fe8aa9107a94757606a3a1837b6a448ab
|