Azure / azure-linux-extensions

Linux Virtual Machine Extensions for Azure
Apache License 2.0
304 stars 252 forks source link

[BugFix] Handled cases when eventLoggingFolder is not provided in HandlerEnvironment #1855

Closed ankitha-p closed 9 months ago

ankitha-p commented 9 months ago

When the eventLoggingFolder parameter is unavailable in HandlerEnvironment.json file, currently the backups are failing with the below logs

Unable to parse context, error: 'eventsFolder', stack trace: Traceback (most recent call last):
  File "/var/lib/waagent/Microsoft.Azure.RecoveryServices.VMSnapshotLinux-1.0.9213.0/main/Utils/HandlerUtil.py", line 298, in try_parse_context
    self._context._event_dir = handler_env['handlerEnvironment']['eventsFolder']
KeyError: 'eventsFolder'

Added handling for the above.