eoptasks: add ignorelist
(so it's not necessary to keep local commits in the puppet repository to disable servers such as villejuif-test)
This commit is contained in:
parent
47ba6bced9
commit
a0b137de9c
|
@ -13,6 +13,11 @@
|
|||
# and apt.upgrade.
|
||||
#
|
||||
# Requirements: libtmux and pyyaml.
|
||||
#
|
||||
# Configuration: ~/.config/eoptasks.ini
|
||||
# [config]
|
||||
# servergroups = /path/to/servergroups.yaml
|
||||
# ignore = server1, server2
|
||||
|
||||
import argparse
|
||||
import configparser
|
||||
|
@ -64,10 +69,13 @@ def get_servers():
|
|||
" [config]\n"
|
||||
" servergroups = /home/user/src/puppet/data/servergroups.yaml\n")
|
||||
sys.exit(1)
|
||||
ignorelist = [x.strip() for x in config.get('config', 'ignore', fallback='').split(',')]
|
||||
|
||||
servergroups = yaml.load(open(servergroup))['servergroups']
|
||||
for group in servergroups:
|
||||
for servername in servergroups[group]:
|
||||
if servername in ignorelist:
|
||||
continue
|
||||
servers.append(Server(servername, group))
|
||||
return servers
|
||||
|
||||
|
|
Loading…
Reference in New Issue