summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2020-06-04 20:30:28 +0000
committerBen Hutchings <ben.hutchings@codethink.co.uk>2020-06-04 20:30:28 +0000
commit20d0ce903cb15913efde6fd6c81c116acb894b8a (patch)
tree4344916fc4b306ed289a137c95808420ead2065f
parent31c3ffc26a55557757fa7476eb2d61f3268851d8 (diff)
parentd7a7e483a3792f8d7b9af0ee8f45000a44e5e881 (diff)
downloadlorry-controller-20d0ce903cb15913efde6fd6c81c116acb894b8a.tar.gz
Merge branch 'bwh/de-trove-ify' into 'master'
Generalise references to 'Trove' Closes #3 See merge request CodethinkLabs/lorry-controller!4
-rw-r--r--ARCH58
-rw-r--r--README64
-rwxr-xr-xlorry-controller-webapp12
-rw-r--r--lorrycontroller/__init__.py4
-rw-r--r--lorrycontroller/givemejob.py8
-rw-r--r--lorrycontroller/lsupstreams.py (renamed from lorrycontroller/lstroves.py)127
-rw-r--r--lorrycontroller/readconf.py33
-rw-r--r--lorrycontroller/statedb.py99
-rw-r--r--lorrycontroller/status.py22
-rw-r--r--templates/lorry.tpl2
-rw-r--r--templates/status.tpl10
-rw-r--r--units/lorry-controller-ls-upstreams.service (renamed from units/lorry-controller-ls-troves.service)2
-rw-r--r--units/lorry-controller-ls-upstreams.timer (renamed from units/lorry-controller-ls-troves.timer)2
-rw-r--r--yarns.webapp/020-status.yarn2
-rw-r--r--yarns.webapp/050-hosts.yarn (renamed from yarns.webapp/050-troves.yarn)40
-rw-r--r--yarns.webapp/900-implementations.yarn14
16 files changed, 253 insertions, 246 deletions
diff --git a/ARCH b/ARCH
index 5721aba..152ae33 100644
--- a/ARCH
+++ b/ARCH
@@ -21,13 +21,19 @@ Some concepts/terminology:
upstream version control repository or tarball. Note that a `.lorry`
file may contain several specifications.
-* Trove specification: which remote Trove to mirror. This gets
+* Upstream Host: a git hosting server that Lorry Controller mirrors
+ from.
+
+* Host specification: which Upstream Host to mirror. This gets
broken into generated Lorry specifications, one per git repository
- on the other Trove. There can be many Trove specifications to
- mirror many Troves.
+ on the other Host. There can be many Host specifications to
+ mirror many Hosts.
+
+* Downstream Host: a git hosting server that Lorry Controller mirrors
+ to.
* run queue: all the Lorry specifications (from CONFGIT or generated
- from the Trove specifications) a Lorry Controller knows about; this
+ from the Host specifications) a Lorry Controller knows about; this
is the set of things that get scheduled. The queue has a linear
order (first job in the queue is the next job to execute).
@@ -38,6 +44,9 @@ Some concepts/terminology:
* admin: a person who can control or reconfigure a Lorry Controller
instance. All users of the HTTP API are admins, for example.
+For historical reasons, Hosts are also referred to as Troves in many
+places.
+
Original set of requirements, which have been broken down and detailed
up below:
@@ -62,15 +71,15 @@ up below:
The detailed requirements (prefixed by a unique identfier, which is
used elsewhere to refer to the exact requirement):
-* (FW) Lorry Controller can access upstream Troves from behind firewalls.
- * (FW/H) Lorry Controller can access the upstream Trove using HTTP or
+* (FW) Lorry Controller can access Upstream Hosts from behind firewalls.
+ * (FW/H) Lorry Controller can access the Upstream Host using HTTP or
HTTPS only, without using ssh, in order to get a list of
repositories to mirror. (Lorry itself also needs to be able to
- access the upstream Trove using HTTP or HTTPS only, bypassing
+ access the Upstream Host using HTTP or HTTPS only, bypassing
ssh, but that's a Lorry problem and outside the scope of Lorry
Controller, so it'll need to be dealt separately.)
* (FW/C) Lorry Controller does not verify SSL/TLS certificates
- when accessing the upstream Trove.
+ when accessing the Upstream Host.
* (RC) Lorry Controller can be reconfigured at runtime.
* (RC/ADD) A new Lorry specification can be added to CONFGIT, and
a running Lorry Controller will add them to its run queue as
@@ -101,7 +110,7 @@ used elsewhere to refer to the exact requirement):
the run queue for any information the Lorry Controller holds for
them, such as the last time they successfully finished running.
* (RR) Lorry Controller is reasonably robust.
- * (RR/CONF) Lorry Controller ignores any broken Lorry or Trove
+ * (RR/CONF) Lorry Controller ignores any broken Lorry or Host
specifications in CONFGIT, and runs without them.
* (RR/TIMEOUT) Lorry Controller stops a job that runs for too
long.
@@ -153,10 +162,9 @@ Entities
communicate with the Lorry Controller.
* Lorry Controller runs Lorry appropriately, and consists of several
components described below.
-* The local Trove is where Lorry Controller tells its Lorry to push
- the results.
-* Upstream Trove is a Trove that Lorry Controller mirrors to the local
- Trove. There can be multiple upstream Troves.
+* The Downstream Host is as defined in Requirements.
+* An Upstream Host is as defined in Requirements. There can be
+ multiple Upstream Hosts.
Components of Lorry Controller
------------------------------
@@ -164,11 +172,11 @@ Components of Lorry Controller
* CONFGIT is a git repository for Lorry Controller configuration,
which the Lorry Controller (see WEBAPP below) can access and pull
from. Pushing is not required and should be prevented by Gitano.
- CONFGIT is hosted on the local Trove.
+ CONFGIT is hosted on the Downstream Host.
* STATEDB is persistent storage for the Lorry Controller's state: what
Lorry specs it knows about (provided by the admin, or generated from
- a Trove spec by Lorry Controller itself), their ordering, jobs that
+ a Host spec by Lorry Controller itself), their ordering, jobs that
have been run or are being run, information about the jobs, etc. The
idea is that the Lorry Controller process can terminate (cleanly or
by crashing), and be restarted, and continue approximately from
@@ -218,8 +226,8 @@ How the components work together
report state as stored in STATEDB. Commands cause the WEBAPP
instance to do something and alter STATEDB accordingly.
-* When an admin makes changes to CONFGIT, and pushes them to the local
- Trove, the Trove's git post-update hook makes an HTTP request to
+* When an admin makes changes to CONFGIT, and pushes them to the Downstream
+ Host, the Host's git post-update hook makes an HTTP request to
WEBAPP to update STATEDB from CONFGIT. (RC/ADD, RC/RM)
* Each MINION likewise communicates only with the WEBAPP using HTTP
@@ -349,13 +357,13 @@ Other requests:
admin (there is a button on the `/1.0/status-html` web page).
* `POST /1.0/ls-troves` causes WEBAPP to refresh its list of
- repositories in each remote Trove, if the current list is too old
- (see the `ls-interval` setting for each remote trove in
+ repositories in each Upstream Host, if the current list is too old
+ (see the `ls-interval` setting for each Upstream Host in
`lorry-controller.conf`). This gets called from a systemd timer unit
at a suitable interval.
* `POST /1.0/force-ls-troves` causes the repository refresh to happen
- for all remote Troves, regardless of whether it is due or not. This
+ for all Upstream Hosts, regardless of whether it is due or not. This
can be called manually by an admin.
@@ -397,7 +405,7 @@ requests.
The `lorries` table implements the run-queue: all the Lorry specs that
WEBAPP knows about. It has the following columns:
-* `path` is the path of the git repository on the local Trove, i.e.,
+* `path` is the path of the git repository on the Downstream Host, i.e.,
the git repository to which Lorry will push. This is a unique
identifier. It is used, for example, to determine if a Lorry spec
is obsolete after a CONFGIT update.
@@ -433,7 +441,7 @@ The Lorry Controller code base is laid out as follows:
* `static` has static content to be served over HTTP. Primarily, the
CSS file for the HTML interfaces. When LC is integrated within the
- Trove, the web server gets configured to serve these files directly.
+ Downstream Host, the web server gets configured to serve these files directly.
The `static` directory will be accessible over plain HTTP on port
80, and on port 12765 via the WEBAPP, to allow HTML pages to refer
to it via a simple path.
@@ -480,9 +488,9 @@ statements to provide locking. To access STATEDB with locking, use
code such as this:
with self.open_statedb() as statedb:
- troves = statedb.get_troves()
- for trove in troves:
- statedb.remove_trove(troves)
+ hosts = statedb.get_hosts()
+ for host in hosts:
+ statedb.remove_host(hosts)
The code executed by the `with` statement is run under lock, and the
lock gets released automatically even if there is an exception.
diff --git a/README b/README
index 8455e35..34a1d1f 100644
--- a/README
+++ b/README
@@ -5,15 +5,14 @@ Overview
--------
Lorry Controller, or LC for short, manages the importing of source
-code from external sources into git repositories on a Trove. A Trove
-is a component in the Baserock system for hosting source code, and LC
-runs inside a Trove.
+code from external sources into git repositories on a Trove, GitLab,
+or Gerrit server (Downstream Host).
LC uses the Lorry tool to do the actual import. Lorry can read code
from several different version control systems, and convert them to
git. External repositories can be specfied individually, as Lorry
`.lorry` specification files. In addition, LC can be told to mirror
-all the git repositories on another Trove.
+all the git repositories on a Trove or GitLab server (Upstream Host).
LC runs Lorry for the right external repositories, and takes care of
running a suitable number of Lorry instances concurrently, and
@@ -34,7 +33,7 @@ level. For information about these options, run
`lorry-controller-webapp --help` to get a list of them.
The second level is a git repository that specifies which external
-repositories and other Troves to import into the Trove LC runs on.
+repositories and Upstream Hosts to import into the Downstream Host.
This git repository is referred to as CONFGIT in documentation, and is
specified with the the `--confgit-url` command line option, or the
`confgit-url` key in the configuration file. The configuration file
@@ -64,7 +63,7 @@ The `lorry-controller.conf` file
--------------------------------
`lorry-controller.conf` is a JSON file containing a list of maps. Each
-map specifies another Trove, a GitLab instance, or one set of `.lorry`
+map specifies an Upstream Host or one set of `.lorry`
files. Here's an example that tells LC to mirror the `git.baserock.org`
Trove and anything in the `open-source-lorries/*.lorry` files (if any
exist).
@@ -94,46 +93,44 @@ exist).
}
]
-A Trove specification (map) uses the following mandatory keys:
+A Host specification (map) uses the following mandatory keys:
-* `type: trove` -- specify it's a Trove specification.
+* `type:` -- either `trove` or `gitlab`, depending on the type of
+ Upstream Host.
-* `host` -- the other Trove to mirror; a domain name or IP address.
+* `host` -- the Upstream Host to mirror; a domain name or IP address.
* `protocol` -- specify how Lorry Controller (and Lorry) should talk
- to other Troves. Allowed values are `ssh`, `https`, `http`.
+ to the Upstream Host. Allowed values are `ssh`, `https`, `http`.
-* `prefixmap` -- map repository path prefixes from the other Trove to
- the local Trove. If the remote prefix is `foo`, and the local prefix
- is `bar`, then remote repository `foo/baserock/yeehaa` gets mirrored
- to local repository `bar/baserock/yeehaa`. If the remote Trove has a
- repository that does not match a prefix, that repository gets
- ignored.
+* `prefixmap` -- map repository path prefixes from the Upstream Host
+ to the Downstream Host. If the upstream prefix is `foo`, and the
+ downstream prefix is `bar`, then upstream repository
+ `foo/baserock/yeehaa` gets mirrored to downstream repository
+ `bar/baserock/yeehaa`. If the Upstream Host has a repository that
+ does not match a prefix, that repository gets ignored.
* `ls-interval` -- determine how often should Lorry Controller query
- the other Trove for a list of repositories it may mirror. See below
+ the Upstream Host for a list of repositories it may mirror. See below
for how the value is interpreted. The default is 24 hours.
* `interval` -- specify how often Lorry Controller should mirror the
repositories in the spec. See below for INTERVAL. The default
interval is 24 hours.
-Additionally, the following optional keys are allowed in Trove
+Additionally, the following optional keys are allowed in Host
specifications:
-* `ignore` -- a list of git repositories from the other Trove that
+* `ignore` -- a list of git repositories from the Upstream Host that
should NOT be mirrored. Each list element is a glob pattern which
is matched against the path to the git repository (not including leading
slash).
-* `auth` -- specify how to authenticate to the remote Trove over https
+* `auth` -- specify how to authenticate to the Upstream Host over https
(only). It should be a dictionary with the fields `username` and
`password`.
-A GitLab specification (map) makes use of the same keys as a Trove,
-however it uses an additional mandatory key:
-
-* `type: gitlab` -- specify it's a GitLab specification.
+A GitLab specification (map) uses an additional mandatory key:
* `private-token` -- the GitLab private token for a user with the
minimum permissions of master of any group you may wish to create
@@ -145,7 +142,7 @@ mandatory:
* `type: lorries` -- specify it's a Lorry specification.
* `interval` -- identical in meaning to the `interval` in a
- Trove specification.
+ Host specification.
* `prefix` -- a path prefix to be prepended to all repositories
created from the `.lorry` files from this spec.
@@ -191,15 +188,16 @@ must be controlled appropriately.
WEBAPP 'Admin' Interface
------------------------
-A web interface for managing lorry controller is accessible from
-http://trove/1.0/status-html. A more detailed 'admin' interface runs locally
-on port 12765.
+An 'admin' interface runs locally on port 12765.
-For the moment you can access this interface using an ssh tunnel if you have
-root access to the trove, for example:
+For the moment you can access this interface using an ssh tunnel, for
+example:
-ssh -L 12765:localhost:12765 root@trove
+ssh -L 12765:localhost:12765 root@lorryhost
-will bind 12765 on your localhost to 12765 on the trove, with this running
-you can access the trove 'admin' interface at
+will bind 12765 on your localhost to 12765 on lorryhost, with this running
+you can access the 'admin' interface at
http://localhost:12765/1.0/status-html
+
+When used within Trove, a web interface for managing lorry controller
+is accessible from http://trove/1.0/status-html.
diff --git a/lorry-controller-webapp b/lorry-controller-webapp
index c73333a..9e3a310 100755
--- a/lorry-controller-webapp
+++ b/lorry-controller-webapp
@@ -94,12 +94,12 @@ class WEBAPP(cliapp.Application):
default='0.0.0.0')
self.settings.string_list(
- ['debug-fake-trove'],
- 'fake access to remote Troves (to do gitano ls, etc) '
- 'using local files: get ls listing for TROVE from $PATH, '
+ ['debug-fake-upstream-host'],
+ 'fake access to Upstream Hosts (to do gitano ls, etc) '
+ 'using local files: get ls listing for HOST from $PATH, '
'where PATH names a file in JSON with the necessary info; '
'may be used multiple times',
- metavar='TROVE=PATH')
+ metavar='HOST=PATH')
self.settings.string(
['templates'],
@@ -130,9 +130,9 @@ class WEBAPP(cliapp.Application):
default=10*ONE_MINUTE)
self.settings.choice(
- ['git-server-type'],
+ ['downstream-host-type', 'git-server-type'],
['gitano', 'gerrit', 'gitlab', 'local'],
- 'what API the local Git server speaks')
+ 'what API the Downstream Host speaks')
self.settings.string(
['gitlab-private-token'],
diff --git a/lorrycontroller/__init__.py b/lorrycontroller/__init__.py
index c5bf0ad..64c4a6f 100644
--- a/lorrycontroller/__init__.py
+++ b/lorrycontroller/__init__.py
@@ -18,7 +18,7 @@ from .statedb import (
StateDB,
LorryNotFoundError,
WrongNumberLorriesRunningJob,
- TroveNotFoundError)
+ HostNotFoundError)
from .route import LorryControllerRoute
from .readconf import ReadConfiguration
from .status import Status, StatusHTML, StatusRenderer
@@ -34,7 +34,7 @@ from .listjobs import ListAllJobs, ListAllJobsHTML
from .showjob import ShowJob, ShowJobHTML, JobShower
from .removeghostjobs import RemoveGhostJobs
from .removejob import RemoveJob
-from .lstroves import LsTroves, ForceLsTrove
+from .lsupstreams import LsUpstreams, ForceLsUpstream
from .pretendtime import PretendTime
from .maxjobs import GetMaxJobs, SetMaxJobs
from .gitano import (
diff --git a/lorrycontroller/givemejob.py b/lorrycontroller/givemejob.py
index a893036..9d4d4d2 100644
--- a/lorrycontroller/givemejob.py
+++ b/lorrycontroller/givemejob.py
@@ -37,7 +37,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute):
for lorry_info in lorry_infos:
if self.ready_to_run(lorry_info, now):
self.create_repository(statedb, lorry_info)
- if lorry_info['from_trovehost']:
+ if lorry_info['from_host']:
self.copy_repository_metadata(statedb, lorry_info)
self.give_job_to_minion(statedb, lorry_info, now)
logging.info(
@@ -120,14 +120,14 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute):
def copy_repository_metadata(self, statedb, lorry_info):
'''Copy project.head and project.description to the local Trove.'''
- assert lorry_info['from_trovehost']
+ assert lorry_info['from_host']
assert lorry_info['from_path']
if self.app_settings['git-server-type'] != 'gitano':
# FIXME: would be good to have this info in Gerrit too
return
- remote = lorrycontroller.new_gitano_command(statedb, lorry_info['from_trovehost'])
+ remote = lorrycontroller.new_gitano_command(statedb, lorry_info['from_host'])
local = lorrycontroller.LocalTroveGitanoCommand()
try:
@@ -142,7 +142,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute):
if not local_config['project.description']:
desc = '{host}: {desc}'.format(
- host=lorry_info['from_trovehost'],
+ host=lorry_info['from_host'],
desc=remote_config['project.description'])
local.set_gitano_config(
lorry_info['path'],
diff --git a/lorrycontroller/lstroves.py b/lorrycontroller/lsupstreams.py
index 34648cb..a64a496 100644
--- a/lorrycontroller/lstroves.py
+++ b/lorrycontroller/lsupstreams.py
@@ -33,49 +33,49 @@ class ServerLsError(Exception):
self.remote_host = remote_host
-class TroveRepositoryLister(object):
+class HostRepositoryLister(object):
def __init__(self, app_settings, route):
self.app_settings = app_settings
self.route = route
- def list_trove_into_statedb(self, statedb, trove_info):
- remote_paths = self.ls(statedb, trove_info)
- remote_paths = self.skip_ignored_repos(trove_info, remote_paths)
+ def list_host_into_statedb(self, statedb, host_info):
+ remote_paths = self.ls(statedb, host_info)
+ remote_paths = self.skip_ignored_repos(host_info, remote_paths)
repo_map = self.map_remote_repos_to_local_ones(
- trove_info, remote_paths)
+ host_info, remote_paths)
with statedb:
- self.update_lorries_for_trove(statedb, trove_info, repo_map)
+ self.update_lorries_for_host(statedb, host_info, repo_map)
now = statedb.get_current_time()
- statedb.set_trove_ls_last_run(trove_info['trovehost'], now)
+ statedb.set_host_ls_last_run(host_info['host'], now)
- def ls(self, statedb, trove_info):
- if self.app_settings['debug-fake-trove']:
- repo_paths = self.get_fake_ls_output(trove_info)
+ def ls(self, statedb, host_info):
+ if self.app_settings['debug-fake-upstream-host']:
+ repo_paths = self.get_fake_ls_output(host_info)
else:
- repo_paths = self.get_real_ls_output(statedb, trove_info)
+ repo_paths = self.get_real_ls_output(statedb, host_info)
return repo_paths
- def get_fake_ls_output(self, trove_info):
- trovehost = trove_info['trovehost']
- for item in self.app_settings['debug-fake-trove']:
- host, path = item.split('=', 1)
- if host == trovehost:
+ def get_fake_ls_output(self, host_info):
+ host = host_info['host']
+ for item in self.app_settings['debug-fake-upstream-host']:
+ fake_host, path = item.split('=', 1)
+ if fake_host == host:
with open(path) as f:
obj = json.load(f)
return obj['ls-output']
return None
- def get_real_ls_output(self, statedb, trove_info):
- gitlab_token = trove_info.get('gitlab_token')
+ def get_real_ls_output(self, statedb, host_info):
+ gitlab_token = host_info.get('gitlab_token')
if gitlab_token:
return lorrycontroller.Gitlab(
- trove_info['trovehost'], gitlab_token).list_projects()
+ host_info['host'], gitlab_token).list_projects()
gitano = lorrycontroller.new_gitano_command(
- statedb, trove_info['trovehost'])
+ statedb, host_info['host'])
output = gitano.ls()
return self.parse_ls_output(output)
@@ -87,8 +87,8 @@ class TroveRepositoryLister(object):
repo_paths.append(words[1])
return repo_paths
- def skip_ignored_repos(self, trovehost, repo_paths):
- ignored_patterns = json.loads(trovehost['ignore'])
+ def skip_ignored_repos(self, host, repo_paths):
+ ignored_patterns = json.loads(host['ignore'])
ignored_paths = set()
for pattern in ignored_patterns:
@@ -96,9 +96,9 @@ class TroveRepositoryLister(object):
return set(repo_paths).difference(ignored_paths)
- def map_remote_repos_to_local_ones(self, trove_info, remote_paths):
+ def map_remote_repos_to_local_ones(self, host_info, remote_paths):
'''Return a dict that maps each remote repo path to a local one.'''
- prefixmap = self.parse_prefixmap(trove_info['prefixmap'])
+ prefixmap = self.parse_prefixmap(host_info['prefixmap'])
repo_map = {}
for remote_path in remote_paths:
local_path = self.map_one_remote_repo_to_local_one(
@@ -124,29 +124,29 @@ class TroveRepositoryLister(object):
def path_starts_with_prefix(self, path, prefix):
return path.startswith(prefix) and path[len(prefix):].startswith('/')
- def update_lorries_for_trove(self, statedb, trove_info, repo_map):
- trovehost = trove_info['trovehost']
+ def update_lorries_for_host(self, statedb, host_info, repo_map):
+ host = host_info['host']
for remote_path, local_path in list(repo_map.items()):
- lorry = self.construct_lorry(trove_info, local_path, remote_path)
+ lorry = self.construct_lorry(host_info, local_path, remote_path)
statedb.add_to_lorries(
path=local_path,
text=json.dumps(lorry, indent=4),
- from_trovehost=trovehost,
+ from_host=host,
from_path=remote_path,
- interval=trove_info['lorry_interval'],
- timeout=trove_info['lorry_timeout'])
+ interval=host_info['lorry_interval'],
+ timeout=host_info['lorry_timeout'])
- all_local_paths = set(statedb.get_lorries_for_trove(trovehost))
+ all_local_paths = set(statedb.get_lorries_for_host(host))
wanted_local_paths = set(repo_map.values())
delete_local_paths = all_local_paths.difference(wanted_local_paths)
for local_path in delete_local_paths:
statedb.remove_lorry(local_path)
- def construct_lorry(self, trove_info, local_path, remote_path):
+ def construct_lorry(self, host_info, local_path, remote_path):
return {
local_path: {
'type': 'git',
- 'url': self.construct_lorry_url(trove_info, remote_path),
+ 'url': self.construct_lorry_url(host_info, remote_path),
'refspecs': [
"+refs/heads/*",
"+refs/tags/*",
@@ -154,27 +154,26 @@ class TroveRepositoryLister(object):
}
}
- def construct_lorry_url(self, trove_info, remote_path):
- gitlab_token = trove_info.get('gitlab_token')
+ def construct_lorry_url(self, host_info, remote_path):
+ gitlab_token = host_info.get('gitlab_token')
if gitlab_token:
return lorrycontroller.Gitlab(
- trove_info['trovehost'], gitlab_token).get_project_url(
- trove_info['protocol'], remote_path)
+ host_info['host'], gitlab_token).get_project_url(
+ host_info['protocol'], remote_path)
- vars = dict(trove_info)
+ vars = dict(host_info)
vars['remote_path'] = remote_path
patterns = {
- 'ssh': 'ssh://git@{trovehost}/{remote_path}',
- 'https':
- 'https://{username}:{password}@{trovehost}/git/{remote_path}',
- 'http': 'http://{trovehost}/git/{remote_path}',
+ 'ssh': 'ssh://git@{host}/{remote_path}',
+ 'https':'https://{username}:{password}@{host}/git/{remote_path}',
+ 'http': 'http://{host}/git/{remote_path}',
}
- return patterns[trove_info['protocol']].format(**vars)
+ return patterns[host_info['protocol']].format(**vars)
-class ForceLsTrove(lorrycontroller.LorryControllerRoute):
+class ForceLsUpstream(lorrycontroller.LorryControllerRoute):
http_method = 'POST'
path = '/1.0/force-ls-trove'
@@ -182,20 +181,20 @@ class ForceLsTrove(lorrycontroller.LorryControllerRoute):
def run(self, **kwargs):
logging.info('%s %s called', self.http_method, self.path)
- trovehost = bottle.request.forms.trovehost
+ host = bottle.request.forms.host
statedb = self.open_statedb()
- lister = TroveRepositoryLister(self.app_settings, self)
- trove_info = statedb.get_trove_info(trovehost)
+ lister = HostRepositoryLister(self.app_settings, self)
+ host_info = statedb.get_host_info(host)
try:
- updated = lister.list_trove_into_statedb(statedb, trove_info)
+ updated = lister.list_host_into_statedb(statedb, host_info)
except ServerLsError as e:
raise bottle.abort(500, str(e))
return { 'updated-troves': updated }
-class LsTroves(lorrycontroller.LorryControllerRoute):
+class LsUpstreams(lorrycontroller.LorryControllerRoute):
http_method = 'POST'
path = '/1.0/ls-troves'
@@ -204,30 +203,30 @@ class LsTroves(lorrycontroller.LorryControllerRoute):
logging.info('%s %s called', self.http_method, self.path)
statedb = self.open_statedb()
- lister = TroveRepositoryLister(self.app_settings, self)
+ lister = HostRepositoryLister(self.app_settings, self)
- trove_infos = self.get_due_troves(statedb)
- for trove_info in trove_infos:
- logging.info('Trove %r is due an ls', trove_info['trovehost'])
+ host_infos = self.get_due_hosts(statedb)
+ for host_info in host_infos:
+ logging.info('Host %r is due an ls', host_info['host'])
try:
- lister.list_trove_into_statedb(statedb, trove_info)
+ lister.list_host_into_statedb(statedb, host_info)
except ServerLsError as e:
bottle.abort(500, str(e))
return {
- 'updated-troves': [trove_info['trovehost'] for trove_info in trove_infos],
+ 'updated-troves': [host_info['host'] for host_info in host_infos],
}
- def get_due_troves(self, statedb):
- trove_infos = [
- statedb.get_trove_info(trovehost)
- for trovehost in statedb.get_troves()]
+ def get_due_hosts(self, statedb):
+ host_infos = [
+ statedb.get_host_info(host)
+ for host in statedb.get_hosts()]
now = statedb.get_current_time()
return [
- trove_info
- for trove_info in trove_infos
- if self.is_due(trove_info, now)]
+ host_info
+ for host_info in host_infos
+ if self.is_due(host_info, now)]
- def is_due(self, trove_info, now):
- ls_due = trove_info['ls_last_run'] + trove_info['ls_interval']
+ def is_due(self, host_info, now):
+ ls_due = host_info['ls_last_run'] + host_info['ls_interval']
return ls_due <= now
diff --git a/lorrycontroller/readconf.py b/lorrycontroller/readconf.py
index 4e162a9..b8b4a87 100644
--- a/lorrycontroller/readconf.py
+++ b/lorrycontroller/readconf.py
@@ -61,7 +61,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
statedb = self.open_statedb()
with statedb:
lorries_to_remove = set(statedb.get_lorries_paths())
- troves_to_remove = set(statedb.get_troves())
+ hosts_to_remove = set(statedb.get_hosts())
for section in conf_obj:
if not 'type' in section:
@@ -71,12 +71,12 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
statedb, section)
lorries_to_remove = lorries_to_remove.difference(added)
elif section['type'] in ('trove', 'troves', 'gitlab'):
- self.add_trove(statedb, section)
- trovehost = section.get('host') or section['trovehost']
- if trovehost in troves_to_remove:
- troves_to_remove.remove(trovehost)
+ self.add_host(statedb, section)
+ host = section.get('host') or section['trovehost']
+ if host in hosts_to_remove:
+ hosts_to_remove.remove(host)
lorries_to_remove = lorries_to_remove.difference(
- statedb.get_lorries_for_trove(trovehost))
+ statedb.get_lorries_for_host(host))
else:
logging.error(
'Unknown section in configuration: %r', section)
@@ -87,9 +87,9 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
for path in lorries_to_remove:
statedb.remove_lorry(path)
- for trovehost in troves_to_remove:
- statedb.remove_trove(trovehost)
- statedb.remove_lorries_for_trovehost(trovehost)
+ for host in hosts_to_remove:
+ statedb.remove_host(host)
+ statedb.remove_lorries_for_host(host)
if 'redirect' in bottle.request.forms:
bottle.redirect(bottle.request.forms.redirect)
@@ -215,7 +215,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
old_lorry_info = None
statedb.add_to_lorries(
- path=path, text=text, from_trovehost='', from_path='',
+ path=path, text=text, from_host='', from_path='',
interval=interval, timeout=timeout)
added_paths.add(path)
@@ -282,7 +282,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
new_obj = { path: obj }
return json.dumps(new_obj, indent=4)
- def add_trove(self, statedb, section):
+ def add_host(self, statedb, section):
username = None
password = None
if 'auth' in section:
@@ -294,8 +294,8 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
if section['type'] == 'gitlab':
gitlab_token = section['private-token']
- statedb.add_trove(
- trovehost=section.get('host') or section['trovehost'],
+ statedb.add_host(
+ host=section.get('host') or section['trovehost'],
protocol=section['protocol'],
username=username,
password=password,
@@ -326,7 +326,7 @@ class LorryControllerConfValidator(object):
raise ValidationError(
'section without type: %r' % section)
elif section['type'] in ('trove', 'troves'):
- self._check_troves_section(section)
+ self._check_host_section(section)
elif section['type'] == 'lorries':
self._check_lorries_section(section)
elif section['type'] == 'gitlab':
@@ -350,11 +350,10 @@ class LorryControllerConfValidator(object):
raise ValidationError('all items must be dicts')
def _check_gitlab_section(self, section):
- # gitlab section inherits trove configurations, perform the same checks.
- self._check_troves_section(section)
+ self._check_host_section(section)
self._check_has_required_fields(section, ['private-token'])
- def _check_troves_section(self, section):
+ def _check_host_section(self, section):
if not any(i in ('trovehost', 'host') for i in section):
self._check_has_required_fields(section, ['host'])
self._check_has_required_fields(
diff --git a/lorrycontroller/statedb.py b/lorrycontroller/statedb.py
index b2bac7e..69538ed 100644
--- a/lorrycontroller/statedb.py
+++ b/lorrycontroller/statedb.py
@@ -39,11 +39,11 @@ class WrongNumberLorriesRunningJob(Exception):
(row_count, job_id))
-class TroveNotFoundError(Exception):
+class HostNotFoundError(Exception):
- def __init__(self, trovehost):
+ def __init__(self, host):
Exception.__init__(
- self, 'Trove %s not known in STATEDB' % trovehost)
+ self, 'Host %s not known in STATEDB' % host)
class StateDB(object):
@@ -57,20 +57,20 @@ class StateDB(object):
self._transaction_started = None
self.initial_lorries_fields = [
- ('path', 'TEXT PRIMARY KEY'),
- ('text', 'TEXT'),
- ('from_trovehost', 'TEXT'),
- ('from_path', 'TEXT'),
- ('running_job', 'INT'),
- ('last_run', 'INT'),
- ('interval', 'INT'),
- ('lorry_timeout', 'INT'),
- ('disk_usage', 'INT'),
+ ('path', 'TEXT PRIMARY KEY', None),
+ ('text', 'TEXT', None),
+ ('from_trovehost', 'TEXT', 'from_host'),
+ ('from_path', 'TEXT', None),
+ ('running_job', 'INT', None),
+ ('last_run', 'INT', None),
+ ('interval', 'INT', None),
+ ('lorry_timeout', 'INT', None),
+ ('disk_usage', 'INT', None),
]
self.lorries_fields = list(self.initial_lorries_fields)
self.lorries_fields.extend([
- ('last_run_exit', 'TEXT'),
- ('last_run_error', 'TEXT'),
+ ('last_run_exit', 'TEXT', None),
+ ('last_run_error', 'TEXT', None),
])
self.lorries_booleans = [
]
@@ -114,7 +114,7 @@ class StateDB(object):
c.execute('CREATE TABLE running_queue (running INT)')
c.execute('INSERT INTO running_queue VALUES (1)')
- # Table for known remote Troves.
+ # Table for known remote Hosts.
c.execute(
'CREATE TABLE troves ('
@@ -133,7 +133,8 @@ class StateDB(object):
# Table for all the known lorries (the "run queue").
fields_sql = ', '.join(
- '%s %s' % (name, info) for name, info in self.initial_lorries_fields
+ '%s %s' % (column, info)
+ for column, info, key in self.initial_lorries_fields
)
c.execute('CREATE TABLE lorries (%s)' % fields_sql)
@@ -231,19 +232,19 @@ class StateDB(object):
self.get_cursor().execute(
'UPDATE running_queue SET running = ?', str(new_value))
- def get_trove_info(self, trovehost):
+ def get_host_info(self, host):
c = self.get_cursor()
c.execute(
'SELECT protocol, username, password, lorry_interval, '
'lorry_timeout, ls_interval, ls_last_run, '
'prefixmap, ignore, gitlab_token '
'FROM troves WHERE trovehost IS ?',
- (trovehost,))
+ (host,))
row = c.fetchone()
if row is None:
- raise lorrycontroller.TroveNotFoundError(trovehost)
+ raise lorrycontroller.HostNotFoundError(host)
return {
- 'trovehost': trovehost,
+ 'host': host,
'protocol': row[0],
'username': row[1],
'password': row[2],
@@ -256,16 +257,16 @@ class StateDB(object):
'gitlab_token': row[9]
}
- def add_trove(self, trovehost=None, protocol=None, username=None,
+ def add_host(self, host=None, protocol=None, username=None,
password=None, lorry_interval=None,
lorry_timeout=None, ls_interval=None,
prefixmap=None, ignore=None, gitlab_token=None):
logging.debug(
- 'StateDB.add_trove(%r,%r,%r,%r,%r,%r) called',
- trovehost, lorry_interval, lorry_timeout, ls_interval,
+ 'StateDB.add_host(%r,%r,%r,%r,%r,%r) called',
+ host, lorry_interval, lorry_timeout, ls_interval,
prefixmap, ignore)
- assert trovehost is not None
+ assert host is not None
assert protocol is not None
assert lorry_interval is not None
assert lorry_timeout is not None
@@ -275,8 +276,8 @@ class StateDB(object):
assert self.in_transaction
try:
- self.get_trove_info(trovehost)
- except lorrycontroller.TroveNotFoundError:
+ self.get_host_info(host)
+ except lorrycontroller.HostNotFoundError:
c = self.get_cursor()
c.execute(
'INSERT INTO troves '
@@ -285,7 +286,7 @@ class StateDB(object):
'ls_interval, ls_last_run, '
'prefixmap, ignore, gitlab_token) '
'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
- (trovehost, protocol, username, password,
+ (host, protocol, username, password,
lorry_interval, lorry_timeout, ls_interval, 0,
prefixmap, ignore, gitlab_token))
else:
@@ -296,31 +297,33 @@ class StateDB(object):
'prefixmap=?, ignore=?, protocol=?, gitlab_token=? '
'WHERE trovehost IS ?',
(lorry_interval, lorry_timeout, ls_interval, prefixmap,
- ignore, protocol, gitlab_token, trovehost))
+ ignore, protocol, gitlab_token, host))
- def remove_trove(self, trovehost):
- logging.debug('StateDB.remove_trove(%r) called', trovehost)
+ def remove_host(self, host):
+ logging.debug('StateDB.remove_host(%r) called', host)
assert self.in_transaction
c = self.get_cursor()
- c.execute('DELETE FROM troves WHERE trovehost=?', (trovehost,))
+ c.execute('DELETE FROM troves WHERE trovehost=?', (host,))
- def get_troves(self):
+ def get_hosts(self):
c = self.get_cursor()
c.execute('SELECT trovehost FROM troves')
return [row[0] for row in c.fetchall()]
- def set_trove_ls_last_run(self, trovehost, ls_last_run):
+ def set_host_ls_last_run(self, host, ls_last_run):
logging.debug(
- 'StateDB.set_trove_ls_last_run(%r,%r) called',
- trovehost, ls_last_run)
+ 'StateDB.set_host_ls_last_run(%r,%r) called',
+ host, ls_last_run)
assert self.in_transaction
c = self.get_cursor()
c.execute(
'UPDATE troves SET ls_last_run=? WHERE trovehost=?',
- (ls_last_run, trovehost))
+ (ls_last_run, host))
def make_lorry_info_from_row(self, row):
- result = dict((t[0], row[i]) for i, t in enumerate(self.lorries_fields))
+ result = dict(
+ (key or column, row[i])
+ for i, (column, info, key) in enumerate(self.lorries_fields))
for field in self.lorries_booleans:
result[field] = bool(result[field])
return result
@@ -345,27 +348,27 @@ class StateDB(object):
for row in c.execute(
'SELECT path FROM lorries ORDER BY (last_run + interval)')]
- def get_lorries_for_trove(self, trovehost):
+ def get_lorries_for_host(self, host):
c = self.get_cursor()
c.execute(
- 'SELECT path FROM lorries WHERE from_trovehost IS ?', (trovehost,))
+ 'SELECT path FROM lorries WHERE from_trovehost IS ?', (host,))
return [row[0] for row in c.fetchall()]
- def add_to_lorries(self, path=None, text=None, from_trovehost=None,
+ def add_to_lorries(self, path=None, text=None, from_host=None,
from_path=None, interval=None, timeout=None):
logging.debug(
'StateDB.add_to_lorries('
- 'path=%r, text=%r, from_trovehost=%r, interval=%s, '
+ 'path=%r, text=%r, from_host=%r, interval=%s, '
'timeout=%r called',
path,
text,
- from_trovehost,
+ from_host,
interval,
timeout)
assert path is not None
assert text is not None
- assert from_trovehost is not None
+ assert from_host is not None
assert from_path is not None
assert interval is not None
assert timeout is not None
@@ -380,7 +383,7 @@ class StateDB(object):
'(path, text, from_trovehost, from_path, last_run, interval, '
'lorry_timeout, running_job) '
'VALUES (?, ?, ?, ?, ?, ?, ?, ?)',
- (path, text, from_trovehost, from_path, 0,
+ (path, text, from_host, from_path, 0,
interval, timeout, None))
else:
c = self.get_cursor()
@@ -389,7 +392,7 @@ class StateDB(object):
'SET text=?, from_trovehost=?, from_path=?, interval=?, '
'lorry_timeout=? '
'WHERE path IS ?',
- (text, from_trovehost, from_path, interval, timeout, path))
+ (text, from_host, from_path, interval, timeout, path))
def remove_lorry(self, path):
logging.debug('StateDB.remove_lorry(%r) called', path)
@@ -397,12 +400,12 @@ class StateDB(object):
c = self.get_cursor()
c.execute('DELETE FROM lorries WHERE path IS ?', (path,))
- def remove_lorries_for_trovehost(self, trovehost):
+ def remove_lorries_for_host(self, host):
logging.debug(
- 'StateDB.remove_lorries_for_trovest(%r) called', trovehost)
+ 'StateDB.remove_lorries_for_host(%r) called', host)
assert self.in_transaction
c = self.get_cursor()
- c.execute('DELETE FROM lorries WHERE from_trovehost IS ?', (trovehost,))
+ c.execute('DELETE FROM lorries WHERE from_trovehost IS ?', (host,))
def set_running_job(self, path, job_id):
logging.debug(
diff --git a/lorrycontroller/status.py b/lorrycontroller/status.py
index 2e6334d..cca8e8a 100644
--- a/lorrycontroller/status.py
+++ b/lorrycontroller/status.py
@@ -36,7 +36,7 @@ class StatusRenderer(object):
'timestamp':
time.strftime('%Y-%m-%d %H:%M:%S UTC', time.gmtime(now)),
'run_queue': self.get_run_queue(statedb),
- 'troves': self.get_troves(statedb),
+ 'hosts': self.get_hosts(statedb),
'warning_msg': '',
'max_jobs': self.get_max_jobs(statedb),
'links': True,
@@ -148,20 +148,20 @@ class StatusRenderer(object):
return ' '.join(result)
- def get_troves(self, statedb):
- troves = []
- for trovehost in statedb.get_troves():
- trove_info = statedb.get_trove_info(trovehost)
+ def get_hosts(self, statedb):
+ hosts = []
+ for host in statedb.get_hosts():
+ host_info = statedb.get_host_info(host)
- trove_info['ls_interval_nice'] = self.format_secs_nicely(
- trove_info['ls_interval'])
+ host_info['ls_interval_nice'] = self.format_secs_nicely(
+ host_info['ls_interval'])
- ls_due = trove_info['ls_last_run'] + trove_info['ls_interval']
+ ls_due = host_info['ls_last_run'] + host_info['ls_interval']
now = int(statedb.get_current_time())
- trove_info['ls_due_nice'] = self.format_due_nicely(ls_due, now)
+ host_info['ls_due_nice'] = self.format_due_nicely(ls_due, now)
- troves.append(trove_info)
- return troves
+ hosts.append(host_info)
+ return hosts
def get_max_jobs(self, statedb):
max_jobs = statedb.get_max_jobs()
diff --git a/templates/lorry.tpl b/templates/lorry.tpl
index 7c475e0..22760d4 100644
--- a/templates/lorry.tpl
+++ b/templates/lorry.tpl
@@ -17,7 +17,7 @@
<tr> <th>Interval</th> <td>{{lorry['interval_nice']}} ({{lorry['interval']}} s)</td> </tr>
<tr> <th>Last run</th> <td>{{lorry['last_run_nice']}}</td> </tr>
<tr> <th>Due</th> <td>{{lorry['due_nice']}}</td> </tr>
-<tr> <th>From Trove</th> <td>{{lorry['from_trovehost']}}</td> </tr>
+<tr> <th>From Host</th> <td>{{lorry['from_host']}}</td> </tr>
<tr> <th>Disk usage</th> <td>{{lorry['disk_usage_nice']}}</td> </tr>
<tr> <th>Job?</th>
diff --git a/templates/status.tpl b/templates/status.tpl
index 46fe034..277b4b8 100644
--- a/templates/status.tpl
+++ b/templates/status.tpl
@@ -48,17 +48,17 @@
<p>Free disk space: {{disk_free_gib}} GiB.</p>
-<h2>Remote Troves</h2>
+<h2>Upstream Hosts</h2>
<table>
<tr>
-<th>Trove host</th>
+<th>Host</th>
<th>Due for re-scan of remote repositories</th>
</tr>
-% for trove_info in troves:
+% for host_info in hosts:
<tr>
-<td>{{trove_info['trovehost']}}</td>
-<td>{{trove_info['ls_due_nice']}}</td>
+<td>{{host_info['host']}}</td>
+<td>{{host_info['ls_due_nice']}}</td>
</tr>
% end
</table>
diff --git a/units/lorry-controller-ls-troves.service b/units/lorry-controller-ls-upstreams.service
index f7db2e7..8dd6187 100644
--- a/units/lorry-controller-ls-troves.service
+++ b/units/lorry-controller-ls-upstreams.service
@@ -2,7 +2,7 @@
WantedBy=multi-user.target
[Unit]
-Description=Lorry Controller ls-troves
+Description=Lorry Controller ls-upstreams
After=lighttpd-lorry-controller-webapp.service
[Service]
diff --git a/units/lorry-controller-ls-troves.timer b/units/lorry-controller-ls-upstreams.timer
index c5e5ae3..eea5070 100644
--- a/units/lorry-controller-ls-troves.timer
+++ b/units/lorry-controller-ls-upstreams.timer
@@ -2,7 +2,7 @@
WantedBy=multi-user.target
[Unit]
-Description=Lorry Controller ls-troves
+Description=Lorry Controller ls-upstreams
[Timer]
OnUnitInactiveSec=60
diff --git a/yarns.webapp/020-status.yarn b/yarns.webapp/020-status.yarn
index 5749920..8fb8593 100644
--- a/yarns.webapp/020-status.yarn
+++ b/yarns.webapp/020-status.yarn
@@ -3,7 +3,7 @@ WEBAPP status reporting
WEBAPP reports it status via an HTTP request. We verify that when it
starts up, the status is that it is doing nothing: there are no jobs,
-it has no Lorry or Trove specs.
+it has no Lorry or Host specs.
SCENARIO WEBAPP is idle when it starts
GIVEN a running WEBAPP
diff --git a/yarns.webapp/050-troves.yarn b/yarns.webapp/050-hosts.yarn
index 503ac09..dfa9e5b 100644
--- a/yarns.webapp/050-troves.yarn
+++ b/yarns.webapp/050-hosts.yarn
@@ -1,16 +1,16 @@
-Handling of remote Troves
-=========================
+Handling of Upstream Hosts
+==========================
-This chapter has tests for WEBAPP's handling of remote Troves: getting
-the listing of repositories to mirror from the Trove, and creating
+This chapter has tests for WEBAPP's handling of Upstream Hosts: getting
+the listing of repositories to mirror from the Host, and creating
entries in the run-queue for them.
-Reading a remote Trove specification from CONFGIT
--------------------------------------------------
+Reading a Host specification from CONFGIT
+-----------------------------------------
When there's a `troves` section in the Lorry Controller configuration
-file, the WEBAPP should include that in the list of Troves when
+file, the WEBAPP should include that in the list of Hosts when
reported.
SCENARIO a Trove is listed in CONFGIT
@@ -18,55 +18,55 @@ reported.
AND an empty lorry-controller.conf in CONFGIT
AND WEBAPP uses CONFGIT as its configuration directory
-Note that we need to fake a remote Trove, using static files, to keep
+Note that we need to fake an Upstream Host, using static files, to keep
test setup simpler.
- AND WEBAPP fakes Trove example-trove
+ AND WEBAPP fakes Upstream Host example-trove
AND a running WEBAPP
-Initially WEBAPP should report no known Troves, and have an empty
+Initially WEBAPP should report no known Hosts, and have an empty
run-queue.
WHEN admin makes request GET /1.0/status
THEN response has run_queue set to []
- AND response has troves set to []
+ AND response has hosts set to []
Let's add a `troves` section to the configuration file. After WEBAPP
-reads that, it should list the added Trove in status.
+reads that, it should list the added Host in status.
GIVEN lorry-controller.conf in CONFGIT adds trove example-trove
AND lorry-controller.conf in CONFGIT has prefixmap example:example for example-trove
WHEN admin makes request POST /1.0/read-configuration
AND admin makes request GET /1.0/status
- THEN response has troves item 0 field trovehost set to "example-trove"
+ THEN response has hosts item 0 field host set to "example-trove"
However, this should not have made WEBAPP to fetch a new list of
-repositories from the remote Trove.
+repositories from the Upstream Host.
THEN response has run_queue set to []
If we tell WEBAPP to fetch the list, we should see repositories.
- GIVEN remote Trove example-trove has repository example/foo
+ GIVEN Upstream Host example-trove has repository example/foo
WHEN admin makes request POST /1.0/ls-troves
AND admin makes request GET /1.0/list-queue
THEN response has queue set to ["example/foo"]
If we re-read the configuration again, without any changes to it or to
-the fake Trove's repository list, the same Troves and Lorry specs
+the fake Upstream Host's repository list, the same Host and Lorry specs
should remain in STATEDB. (It wasn't always thus, due to a bug.)
WHEN admin makes request POST /1.0/read-configuration
AND admin makes request GET /1.0/status
- THEN response has troves item 0 field trovehost set to "example-trove"
+ THEN response has hosts item 0 field host set to "example-trove"
WHEN admin makes request GET /1.0/list-queue
THEN response has queue set to ["example/foo"]
-If the Trove deletes a repository, we should still keep it locally, to
-avoid disasters. However, it will be removed from the Trove's STATEDB,
+If the Upstream Host deletes a repository, we should still keep it locally, to
+avoid disasters. However, it will be removed from the Host's STATEDB,
and it won't be lorried anymore.
- GIVEN remote Trove example-trove doesn't have repository example/foo
+ GIVEN Upstream Host example-trove doesn't have repository example/foo
WHEN admin makes request POST /1.0/ls-troves
AND admin makes request GET /1.0/list-queue
THEN response has queue set to []
diff --git a/yarns.webapp/900-implementations.yarn b/yarns.webapp/900-implementations.yarn
index 245cd73..9a759ba 100644
--- a/yarns.webapp/900-implementations.yarn
+++ b/yarns.webapp/900-implementations.yarn
@@ -227,15 +227,15 @@ configuration directory is.
add_to_config_file "$DATADIR/webapp.conf" \
configuration-directory "$DATADIR/$MATCH_1"
-Make WEBAPP fake access to a Trove using a static file.
+Make WEBAPP fake access to an Upstream Host using a static file.
- IMPLEMENTS GIVEN WEBAPP fakes Trove (\S+)
+ IMPLEMENTS GIVEN WEBAPP fakes Upstream Host (\S+)
add_to_config_file "$DATADIR/webapp.conf" \
- debug-fake-trove "$MATCH_1=$DATADIR/$MATCH_1.trove"
+ debug-fake-upstream-host "$MATCH_1=$DATADIR/$MATCH_1.trove"
-Control the ls listing of a remote Trove.
+Control the ls listing of an Upstream Host.
- IMPLEMENTS GIVEN remote Trove (\S+) has repository (\S+)
+ IMPLEMENTS GIVEN Upstream Host (\S+) has repository (\S+)
filename="$DATADIR/$MATCH_1.trove"
if [ ! -e "$filename" ]
then
@@ -253,9 +253,9 @@ Control the ls listing of a remote Trove.
json.dump(data, f)
' "$filename"
-Remove a repository from the fake remote Trove.
+Remove a repository from the fake Upstream Host.
- IMPLEMENTS GIVEN remote Trove (\S+) doesn't have repository (\S+)
+ IMPLEMENTS GIVEN Upstream Host (\S+) doesn't have repository (\S+)
filename="$DATADIR/$MATCH_1.trove"
if [ ! -e "$filename" ]
then