bundlewrap/bundles/vmhost/metadata.py

12 lines
411 B
Python
Raw Normal View History

2020-02-29 12:30:06 +00:00
@metadata_processor
def add_users_to_libvirt_group(metadata):
if 'users' in metadata:
for user in metadata['users']:
if 'groups' not in metadata['users'][user]:
metadata['users'][user]['groups'] = []
if 'libvirt' not in metadata['users'][user]['groups']:
metadata['users'][user]['groups'].append('libvirt')
return metadata, RUN_ME_AGAIN