Gerrit < 2.12 used a --name argument on create-project. Newer Gerrit
simply takes the project name as an arg. Check the Gerrit version before
constructing the create-project command.
Change-Id: I59ca051627d54a11ef6524cce9b5a4414fd2193d
The create-project '--name' option was removed[1] in Gerrit 2.12.
Update gerritlib to match the command for Gerrit-2.12+. This is also
compatible with Gerrit 2.11
[1] https://gerrit-review.googlesource.com/#/c/69738/
Change-Id: Ie70d938501cbf88dbbb0e9ab22abcc921f89ccdc
Gerrit supports creating projects that contain spaces in it.
Quote the project name otherwise the command will fail when user
attempts to create a project with spaces in it.
Change-Id: Ie1db92812355b4d8f7603c3b4b8d20434ca54bb3
As of the tox 2.5.0 release, failure to specify a default commands
key in the fallback testenv section of tox.ini instantly fails with
"ERROR: Commands not specified. Please update relevant section of
.../tox.ini".
Copy the testenv.commands entry from the openstack/cookiecutter
repo's template. While at it, copy the boilerplate placeholder test
from the cookiecutter templates so that jobs don't freak out when
they discover (and then run) no tests.
Change-Id: Ifb8fcfbb6d76edd8c7dcf814a705ee7eff3a9819
Until we have a good migration plan for paramika, lets cap at <2.0.0.
Otherwise we need to install libffi-dev and other dependencies for the
version bump.
Change-Id: Iad29f93814c798fc2c4204e08e940011ad1428dc
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This change does the following:
Update docs with more info
Add an example usage of this library
Add pbr versioning to docs
Updates the requirements
Rarrange the docs to look better on pypi
Lots of the elements to do above were borrowed from
python-jenkins and jenkins-job-builder projects.
Change-Id: Idc7dfc88cc26e1147b027fd55d41229c4bf3910f
Based on cookiecutter and slightly tweaked afterward.
* conf.py has autoclass_content = 'both' to generate the __init__
documentation.
* bumped doc copyright to 2015.
* adds in tox environement 'docs' as a convenience
Change-Id: I69bb4179be343ab7c8a44f6fb80d5a428fe30e17
Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.
Change-Id: I25f5dbee234b6d6121beb9ffcf97809dd1a41bb1
Added ability to view extended information about the groups to obtain information about the uuid.
Function listGroups will be used in jeepyb (in file manage-project.py) for checking
and creating groups in gerrit database if groups does not exist.
Change-Id: Id11e358141d3802026bc7e531146e2d84546463d
Enabled functionality into gerritlib for setting descriptions
when creating a project, or have the ability to update
existing projects to update their descriptions.
This will allow jeepyb to create projects into Gerrit
having proper descriptions.
Change-Id: Id7fdef1599e8632edbdd8af5255207c18c9da7e0
Closes-Bug: #1349372
Matches Global Requirements. In the gerritlib project pbr version
does not match the global requirements.
Change-Id: I8d598635916ce2f2659139c90ac31330e158740d
Launchpad points to https://launchpad.net/openstack-ci which I assume is
a catch all.
[setup.cfg]
* skipped files.packages section which is unneeded
* removed obsolete pbr global.setup-hooks
Change-Id: I26bddf6a1bb1ce7a10ea0f8d9f40a916dcba0c90
When creating a new project, if you pass the --empty-commit
flag, a sha is created for the master branch allowing for
cloning and other subsequent actions on the repo. If the project
has no commits and is created without the --empty-commit flag,
the repo is created with no sha for the master branch creating
problems with any subsequent actions on the repo.
Change-Id: Ic233057c2503b7fd9fc234d97d71431520ea70b8
The replication command string changed after replication became a plugin in gerrit.
This patch adds a getVersion[1] and a listPlugins[2] command to gerritlib. The listPlugin
command is used to determine the correct replication string to execute in the replication
command.
[1] Only available on gerrit version >= 2.6
[2] Only available on gerrit version >= 2.5
Closes-Bug: #1273891
Partial-Bug: #1082781
Change-Id: I966037851b3f27536f415230edd1ae4e710321fb
On gerrit 2.4.x and gerrit 2.8 the list returned by the listGroups and listProjects
methods always contains one extra item at the end of the list for example listGroups
returns something like.. ['Administrators', 'Anonymous Users', 'Non-Interactive Users',
'Project Owners','Registered Users', '']
This change removes the last item from the returned list.
Change-Id: I2af52a35ef5bc7fd300b12911fce18faab474222
* gerritlib/gerrit.py(Gerrit.createGroup): Quote the group name in
the API call so that Gerrit won't get confused by spaces.
Change-Id: Iad7110bedc2b5b4090313fd70679f0552292a807
Instead of just maintaining a simple boolean that denotes
whether the thread is connected or not, expose a more rich
set of state transitions that can be used by external users
to know exactly the state the thread is currently in.
This new list is:
* IDLE (not initialized/started running)
* DISCONNECTED (not connected to gerrit)
* CONNECTING (attempting to connect)
* CONNECTED (connected to gerrit)
* CONSUMING (consuming events from gerrit)
* DEAD (thread has exited its run method)
The state transitions are the following:
IDLE -> DISCONNECTED
DISCONNECTED -> CONNECTING
CONNECTING -> CONNECTED
CONNECTED -> CONSUMING
CONSUMING -> DISCONNECTED (on consuming failure)
CONNECTING -> DEAD (if no more retries)
Change-Id: Ib4ecef4f093b6d6925bc4b553020e15111248617
In order to allow the GerritWatcher new features for connection
limits and retry limits to be used we need to have a way to
pass those parameters to the watcher when it is constructed.
Change-Id: I199e515e7105b267acbff55a74e03cb117752bab
Add a connect() function that connects
to the ssh server, if this fails it
does a retry algorithm until that fails
and then the thread dies.
If that works, consume from the given client
and if that fails, allow for retrying using
a new client (after a given consume_retry_delay
delay).
To maintain previous behavior the default of
attempting to connect forever is provided when the
number of connection_attempts is <= 0.
Change-Id: I1a2cb764c7cef04b8137a7e4b05d9a4cc45498b0
The sync script from openstack/requirements was used to write the
setup.py, but we're not REALLY going to sync automatically from o/r.
Remove the comment.
Change-Id: I91cd745010fa8358f8e93e537cc325d94bd9daca
If the GerritWatcher thread is not set as daemon, the program won't
exit when the main thread exits. This is usually undesirable.
As part of making the thread be a daemon, I've moved the ownership of
threading logic to the gerrit startWatching method, decoupling
GerritWatcher's logic from the implementation detail of being a thread
(vs a co-process etc).
Change-Id: Ib28d5bfec47d2c4c88b99e07dec50ee4dd0104bf
We have all the parameters as public attributes, and never want them
to be different so splitting them out is undesirable.
Change-Id: Ie2826af31100fbc287813e2968a126ff2af50f1f
* gerritlib/gerrit.py: Add listGroups() method that will run `gerrit
ls-groups` and return the result as a python list.
Change-Id: I2cb6b7b6a23f3efdb81f90b492c07075c4606c38
extend gerritlib so that we have a query method to get more
complicated query sets. Would rather use gerritlib than raw ssh
commands for this, and this makes it possible.
Change-Id: I467011f027cfc3d594db5f95bb7a5ff46e79b1a8
Switch to pbr and flake8. Make hacking clean. Remove unneeded/unused
libraries. Rename requirements files. Add a README file.
Change-Id: I70408d785331dc97737ab0ab1b0caa255b683efe