bundlewrap/bundles/sudo/metadata.py

12 lines
279 B
Python
Raw Normal View History

2020-03-27 11:52:17 +00:00
@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