Adding retry on error in get_metadata task

- Adding retry on error in get_metadata task
- Fix PEP8
- Removing unnecessary log