diff --git a/docs/en_US/release_notes_5_2.rst b/docs/en_US/release_notes_5_2.rst index 5b879dc3c..4569a80b5 100644 --- a/docs/en_US/release_notes_5_2.rst +++ b/docs/en_US/release_notes_5_2.rst @@ -19,6 +19,7 @@ Bug fixes ********* | `Issue #5519 `_ - Ensure that the query tool tab should be closed after server disconnection when auto-commit/auto-rollback is set to false. +| `Issue #6076 `_ - Fixed an issue where correct error not thrown while importing servers and JSON file has incorrect/insufficient keys. | `Issue #6293 `_ - Fixed an issue where the procedure creation is failed when providing the Volatility option. | `Issue #6327 `_ - Ensure that while comparing domains check function dependencies should be considered in schema diff. | `Issue #6344 `_ - Fixed cannot unpack non-iterable response object error when selecting any partition. diff --git a/web/setup.py b/web/setup.py index 3f054fe03..828b68f11 100644 --- a/web/setup.py +++ b/web/setup.py @@ -181,18 +181,25 @@ def _validate_servers_data(data, is_admin): if attrib not in obj: return ("'%s' attribute not found for server '%s'" % (attrib, server)) + return None - check_attrib("Name") - check_attrib("Group") + for attrib in ("Group", "Name"): + errmsg = check_attrib(attrib) + if errmsg: + return errmsg is_service_attrib_available = obj.get("Service", None) is not None if not is_service_attrib_available: - check_attrib("Port") - check_attrib("Username") + for attrib in ("Port", "Username"): + errmsg = check_attrib(attrib) + if errmsg: + return errmsg - check_attrib("SSLMode") - check_attrib("MaintenanceDB") + for attrib in ("SSLMode", "MaintenanceDB"): + errmsg = check_attrib(attrib) + if errmsg: + return errmsg if "Host" not in obj and "HostAddr" not in obj and not \ is_service_attrib_available: