bundlewrap/bundles/sudo/metadata.py

11 lines
279 B
Python

@metadata_processor
def sudo_users(metadata):
sudoers = []
for username, config in metadata.get('users', {}).items():
if 'sudo' in config and config['sudo']:
sudoers.append(username)
metadata['sudo'] = sudoers
return metadata, RUN_ME_AGAIN