change logic for log rotation removal
@@ -475,11 +475,8 @@ def stop_app(version_key):
for entry in version_entries:
yield unmonitor_and_terminate(entry)
- try:
- projects_manager[project_id]
- except KeyError:
- if not remove_logrotate(project_id):
- logging.error("Error while setting up log rotation for application: {}".
+ if project_id not in projects_manager and not remove_logrotate(project_id):
+ logging.error("Error while removing log rotation for application: {}".
format(project_id))
yield monit_operator.reload()
