diff --git a/.version b/.version index 94fe62c2..dc1e644a 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.5.4 +1.6.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dcc3293..61b83810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,12 @@ Removed - for now removed features Fixed - for any bug fixes Security - in case of vulnerabilities --> +## [1.6.0] - 2024-07-26 + +### Added + +- Added XD224 Paradise mockup + ## [1.5.3] - 2023-11-02 ### Added diff --git a/src/api_emulator/redfish/event_service_api.py b/src/api_emulator/redfish/event_service_api.py index 1de586ba..f7fcfea5 100644 --- a/src/api_emulator/redfish/event_service_api.py +++ b/src/api_emulator/redfish/event_service_api.py @@ -1,6 +1,6 @@ # BSD 3-Clause License # -# Copyright 2022-2023 Hewlett Packard Enterprise Development LP +# Copyright 2022-2024 Hewlett Packard Enterprise Development LP # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -59,7 +59,7 @@ s_config = {} s_generator = None members = {} -required = {'Destination', 'EventTypes'} +required = {'Destination'} # Fields required for POST subscription eventTemplates = {} id = 1 @@ -213,11 +213,13 @@ def post(self): return simple_error_response('%s is required' % (field) , 400) ident = '%d' % id - destination = raw_dict['Destination'] - event_types = raw_dict['EventTypes'] - for evType in event_types: - if evType not in e_config['EventTypesForSubscription']: - return 'Invalid EventType %s' % evType, 400 + destination = raw_dict.get('Destination', '') + event_types = raw_dict.get('EventTypes', '') + if 'EventTypesForSubscription' in e_config: # XD224 Paradise does not have this field + for evType in event_types: + if evType not in e_config['EventTypesForSubscription']: + return 'Invalid EventType %s' % evType, 400 + if 'Context' in raw_dict: context = raw_dict['Context'] else: @@ -305,9 +307,10 @@ def patch(self, ident): return 'Field %s is not patchable' % field, 400 else: if field == 'RegistryPrefixes' and value != []: - for evType in value: - if evType not in e_config['EventTypesForSubscription']: - return 'Invalid EventType %s' % evType, 400 + if 'EventTypesForSubscription' in e_config: # XD224 Paradise does not have this field + for evType in value: + if evType not in e_config['EventTypesForSubscription']: + return 'Invalid EventType %s' % evType, 400 members[ident][field] = value resp = success_response('PATCH request successful', 200) except Exception: