From 51c2c1d568c0bcb1e3cf12d0075cc5fbdfbcb113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 25 Oct 2016 10:50:16 +0200 Subject: [PATCH] Make it possible for Pillar extensions to add service accounts. --- pillar/api/eve_settings.py | 1 + pillar/cli.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pillar/api/eve_settings.py b/pillar/api/eve_settings.py index 780e23d8..544ea367 100644 --- a/pillar/api/eve_settings.py +++ b/pillar/api/eve_settings.py @@ -121,6 +121,7 @@ users_schema = { }, 'service': { 'type': 'dict', + 'allow_unknown': True, 'schema': { 'badger': { 'type': 'list', diff --git a/pillar/cli.py b/pillar/cli.py index 456b464b..27722788 100644 --- a/pillar/cli.py +++ b/pillar/cli.py @@ -268,7 +268,7 @@ def badger(action, user_email, role): log.info('Status : %i', status) -def _create_service_account(email, service_roles, service_definition): +def create_service_account(email, service_roles, service_definition): from pillar.api import service from pillar.api.utils import dumps @@ -295,14 +295,14 @@ def create_badger_account(email, badges): this account can assign and revoke. """ - _create_service_account(email, [u'badger'], {'badger': badges.strip().split()}) + create_service_account(email, [u'badger'], {'badger': badges.strip().split()}) @manager.command def create_urler_account(email): """Creates a new service account that can fetch all project URLs.""" - _create_service_account(email, [u'urler'], {}) + create_service_account(email, [u'urler'], {}) @manager.command