Skip to content

Commit

Permalink
add sdk and api versions on some errors
Browse files Browse the repository at this point in the history
Signed-off-by: matthias.gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Jul 2, 2024
1 parent 4e31ebe commit 2e8d473
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions osc_sdk_python/outscale_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .call import Call
from .credentials import Credentials
import ruamel.yaml
from osc_sdk_python import __version__

type_mapping = {'boolean': 'bool',
'string': 'str',
Expand Down Expand Up @@ -158,12 +159,14 @@ def _check_parameters_valid(self, action_name, params):
input_parameters = set(params)
different_parameters = list(input_parameters.difference(set(structure_parameters)))
if different_parameters:
raise ParameterNotValid("""{}. Available parameters are: {}.""".format(', '.join(different_parameters),
', '.join(structure_parameters)))
raise ParameterNotValid("""{}. Available parameters on sdk: {} api: {} are: {}.""".format(
', '.join(different_parameters),
__version__, self.api_version,
', '.join(structure_parameters)))

def _check(self, action_name, **params):
if action_name not in self.gateway_structure:
raise ActionNotExists('Action {} does not exists'.format(action_name))
raise ActionNotExists('Action {} does not exists for python sdk: {} with api: {}'.format(action_name, __version__, self.api_version))
self._check_parameters_valid(action_name, params)
self._check_parameters_required(self.gateway_structure[action_name], params)
self._check_parameters_type(self.gateway_structure[action_name], params)
Expand Down

0 comments on commit 2e8d473

Please sign in to comment.