diff --git a/gerrit_fake_http_server.py b/gerrit_fake_http_server.py index 75c50ac..fe5df6a 100644 --- a/gerrit_fake_http_server.py +++ b/gerrit_fake_http_server.py @@ -1,70 +1,85 @@ -import bottle - - -@bottle.route('/plugins/events-log/') -def events(params=None): - return """ -)]}' -{ - "name": "plugins/events-log", - "clone_url": "http://localhost:8181/plugins/events-log", - "description": "This plugin listens to stream events and stores them in a database. The events can be retrieved through REST API." -}""" - - -@bottle.route('/a/projects/') -def projects(params=None): - """ - Possible params (accessible via bottle.request.params) is 'd' - """ - print(params) - return { - "All-Projects": { - "id": "All-Projects", - "description": "Rights inherited by all other projects.", - "state": "ACTIVE", - "web_links": [ - { - "name": "browse", - "url": "/plugins/gitiles/All-Projects", - "target": "_blank" - } - ] - }, - "All-Users": { - "id": "All-Users", - "description": "Individual user settings and preferences.", - "state": "ACTIVE", - "web_links": [ - { - "name": "browse", - "url": "/plugins/gitiles/All-Users", - "target": "_blank" - } - ] - }, - "DEDICATED": { - "id": "DEDICATED", - "state": "ACTIVE", - "web_links": [ - { - "name": "browse", - "url": "/plugins/gitiles/DEDICATED", - "target": "_blank" - } - ] - }, - "DEDICATED/ironic": { - "id": "DEDICATED%2Fironic", - "state": "ACTIVE", - "web_links": [ - { - "name": "browse", - "url": "/plugins/gitiles/DEDICATED/ironic", - "target": "_blank" - } - ] - } -} - -bottle.run(host='localhost', port=8181, debug=True) +import bottle + + +@bottle.route('/plugins/events-log/') +def events(params=None): + return bottle.redirect('/plugins/events-log/Documentation/index.html', code=302) + +@bottle.route('/plugins/events-log/Documentation/index.html') +def events(params=None): + return """ +Plugin events-log +

Plugin events-log

+ + +
Nameevents-log plugin
Versionv2.13-178-g68fcb6a4b1
+

About

+

This plugin listens to stream events and stores them in a database. The events can be retrieved through REST API. Some use cases for this plugin include debugging for admins; also users who use scripts which listen to stream events can query for any events that they might have missed.

+

Documentation

+ +

REST APIs

+ + +""" + +@bottle.route('/a/projects/') +def projects(params=None): + """ + Possible params (accessible via bottle.request.params) is 'd' + """ + print(params) + return { + "All-Projects": { + "id": "All-Projects", + "description": "Rights inherited by all other projects.", + "state": "ACTIVE", + "web_links": [ + { + "name": "browse", + "url": "/plugins/gitiles/All-Projects", + "target": "_blank" + } + ] + }, + "All-Users": { + "id": "All-Users", + "description": "Individual user settings and preferences.", + "state": "ACTIVE", + "web_links": [ + { + "name": "browse", + "url": "/plugins/gitiles/All-Users", + "target": "_blank" + } + ] + }, + "DEDICATED": { + "id": "DEDICATED", + "state": "ACTIVE", + "web_links": [ + { + "name": "browse", + "url": "/plugins/gitiles/DEDICATED", + "target": "_blank" + } + ] + }, + "DEDICATED/ironic": { + "id": "DEDICATED%2Fironic", + "state": "ACTIVE", + "web_links": [ + { + "name": "browse", + "url": "/plugins/gitiles/DEDICATED/ironic", + "target": "_blank" + } + ] + } +} + +bottle.run(host='localhost', port=8181, debug=True) diff --git a/gerrit_fake_ssh_server.py b/gerrit_fake_ssh_server.py index 01994ae..7684ed6 100644 --- a/gerrit_fake_ssh_server.py +++ b/gerrit_fake_ssh_server.py @@ -27,7 +27,7 @@ openstack openstack/nova openstack/neutron """ -GERRIT_CMD_VERSION = "ferrit version 1.0.0\n" +GERRIT_CMD_VERSION = "ferrit version 2.16.7\n" GERRIT_SHELL_MSG = """\r **** Welcome to Ferrit Code Review ****\r \r @@ -99,7 +99,7 @@ class Server(paramiko.ServerInterface): def check_global_request(self, kind, msg): LOG.debug('%s', inspect.stack()[0][3]) - LOG.debug('kind: %s, msg: %s', kind, msg) + LOG.debug('kind: %s, msg: %s', kind, str(msg)) return True def check_channel_env_request(self, channel, name, value):