Fix rstrip misuse in frappy-generator

rstrip uses its argument as a set of characters to strip from the
string. Cut the last four characters with a slice if applicable.

Change-Id: Ia2198acf43f92d6f5d687122301f4a5e5324ac31
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31181
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft
2023-05-25 09:28:04 +02:00
parent a643093934
commit af0f9b39b5

View File

@ -39,7 +39,7 @@ def main():
frappy_unit = '/lib/systemd/system/frappy@.service'
wants_dir = normal_dir + '/frappy.target.wants'
all_servers = [base.rstrip('_cfg') for (base, ext) in
all_servers = [base[:-4] if base.endswith('_cfg') else base for (base, ext) in
map(path.splitext, os.listdir(config_dir)) if ext == '.py']
all_servers.sort()