[reprotest] 01/03: FIX: reprotest: get_all_servers: string formatting
Ximin Luo
infinity0 at debian.org
Fri Sep 8 16:01:35 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository reprotest.
commit 86499b7851b0e8ef90c2cabaa6a854dfe1ae47f7
Author: Santiago Torres <torresariass at gmail.com>
Date: Fri Sep 8 00:42:25 2017 -0400
FIX: reprotest: get_all_servers: string formatting
The strings on get_all_servers() would use a negative index to truncate
part of the last filename. As of the previous commit, the relevant name
of the server-name is the name after the prefix (that was correctly
indicated).
Use positive indexing to properly extract the name of the virtual
server. Additionally, add a comma as a parameter to the join to neatly
space all the choices.
---
reprotest/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 8362fc1..d80f0fb 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -44,7 +44,7 @@ def get_all_servers():
global all_servers
if all_servers is None:
server_dir = get_server_path(None)
- all_servers = sorted(fn[:-len(VIRT_PREFIX)] for fn in os.listdir(server_dir)
+ all_servers = sorted(fn[len(VIRT_PREFIX):] for fn in os.listdir(server_dir)
if is_executable(server_dir, fn) and fn.startswith(VIRT_PREFIX))
return all_servers
@@ -610,7 +610,7 @@ def cli_parser():
'are omitted, you should put a "--" between these arguments and '
'reprotest\'s own options. Default: "null", to run directly in '
'/tmp. Choices: %s' %
- ''.join(get_all_servers()))
+ ', '.join(get_all_servers()))
parser.add_argument('--help', default=None, const=True, nargs='?',
choices=get_all_servers(), metavar='VIRTUAL_SERVER_NAME',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git
More information about the Reproducible-commits
mailing list