Skip to content

Commit c602d06

Browse files
committed
Add logging statements for handlers
1 parent c2c1ebb commit c602d06

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

geonode/geoserver/management/commands/importlayers.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from django.core.management.base import BaseCommand
3131
from geonode.resource.models import ExecutionRequest
3232
from geonode.upload.handlers.base import BaseHandler
33-
from geonode.upload.handlers.apps import run_setup_hooks
3433

3534

3635
class Command(BaseCommand):
@@ -122,10 +121,6 @@ def __init__(
122121
self.overwrite_existing_layers = overwrite_existing_layers
123122
self.skip_existing_layers = skip_existing_layers
124123
self.tentatives = tentatives
125-
print(f"Current BaseHandler registry: {BaseHandler.get_registry()}")
126-
if not BaseHandler.get_registry():
127-
run_setup_hooks()
128-
print(f"BaseHandler registry after setup: {BaseHandler.get_registry()}")
129124
self.handlers = BaseHandler.get_registry()
130125

131126
def execute(self):
@@ -163,8 +158,10 @@ def process_file(self, file_path, success, errors):
163158
return
164159

165160
handler = self.get_handler(file_path)
161+
print(f"Handler found: {handler.__class__.__name__ if handler else 'None'}")
166162
if not handler and not self.is_archive_file(file_path):
167163
# Ignore unsupported files
164+
print(f"Unsupported file type: {file_path}")
168165
return
169166

170167
if handler:
@@ -207,6 +204,7 @@ def get_handler(self, file_path):
207204

208205
_data = {"base_file": file_path}
209206
for handler_class in self.handlers:
207+
print(f"Checking handler: {handler_class.__name__} for file: {file_path}")
210208
if handler_class.can_handle(_data):
211209
return handler_class()
212210
return None

0 commit comments

Comments
 (0)