check if isinstance(setting.SSH_NFSEN_CREDENTIALS, dict) - even it's empty, then for loop will have 0 iterations.