From d32f75145676bacefde0d08a14680a5984623451 Mon Sep 17 00:00:00 2001 From: Koren Lev Date: Fri, 29 Sep 2017 01:38:18 +0300 Subject: release 1.0 calipso for opnfv apex Change-Id: I3e63cd27c5f4d3756e67a07c749863a68e84dde2 Signed-off-by: Koren Lev --- app/api/auth/auth.py | 4 ++-- app/api/responders/resource/environment_configs.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'app/api') diff --git a/app/api/auth/auth.py b/app/api/auth/auth.py index 04fc4b9..b7139f4 100644 --- a/app/api/auth/auth.py +++ b/app/api/auth/auth.py @@ -19,7 +19,7 @@ class Auth: super().__init__() self.inv = InventoryMgr() self.log = FullLogger() - self.tokens_coll = self.inv.client['tokens']['api_tokens'] + self.tokens_coll = self.inv.collections['api_tokens'] self.ldap_access = LDAPAccess() def get_token(self, token): @@ -37,7 +37,7 @@ class Auth: self.tokens_coll.insert_one(token) except Exception as e: self.log.error("Failed to write new token {0} to database for {1}" - .format(token[token], str(e))) + .format(token['token'], str(e))) error = 'Failed to create new token' return error diff --git a/app/api/responders/resource/environment_configs.py b/app/api/responders/resource/environment_configs.py index 32e70ad..90a1adf 100644 --- a/app/api/responders/resource/environment_configs.py +++ b/app/api/responders/resource/environment_configs.py @@ -239,6 +239,7 @@ class EnvironmentConfigs(ResponderBase): "configuration": self.require(list, mandatory=True), "distribution": self.require(str, False, DataValidate.LIST, self.distributions, True), + "distribution_version": self.require(str, mandatory=True), "listen": self.require(bool, True, mandatory=True), "user": self.require(str), "mechanism_drivers": self.require(list, False, DataValidate.LIST, @@ -343,8 +344,11 @@ class EnvironmentConfigs(ResponderBase): # validate the environment config with supported environments matches = { 'environment.distribution': env_config['distribution'], + 'environment.distribution_version': + env_config['distribution_version'], 'environment.type_drivers': env_config['type_drivers'], - 'environment.mechanism_drivers': {'$in': env_config['mechanism_drivers']} + 'environment.mechanism_drivers': + {'$in': env_config['mechanism_drivers']} } err_prefix = 'configuration not accepted: ' -- cgit 1.2.3-korg