Skip to content
Snippets Groups Projects

Draft: Fix some error messages when manager is unhappy with webservers

Closed David Hammer requested to merge fix-manager-init-server-errors into master
2 unresolved threads

Every time I set up a new manager, I slightly mess up the webserver configuration. So I've probably seen the corresponding error messages more than just about anyone. Here's an attempt to make them more accurate.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1201 1198 all_req_servers = set(server_by_group.values()).union(
1202 1199 server_by_layer.values())
1203 1200
1204 if all_req_servers != up_servers:
1201 if set(all_req_servers) > set(up_servers):
  • Something is definitely fishy if !=. But I had (I think) mistakenly put two groups on one server, so there were more servers configured than what was needed. Could give different warning in that case.

  • Oh, fair enough, thanks for spotting this. It's probably an odd configuration to put two groups on one server, but I cannot think of a blocker for this right now. If we want to prevent it, you're right that we should validate the configuration in the first place. what do you think?

    I'm surprised by the cast though, both symbols should be sets already.

  • Please register or sign in to reply
  • 994 994 # Query all servers on each host and check whether the ones we
    995 995 # need are in there, and obtain their API names.
    996 996 for host, req_names in hosts.items():
    997 # Retrieve hostname for nice error messages.
    998 hostname = urlparse(self._server_hosts[name]).hostname
    • Can you briefly help me what the difference between host and hostname was?

    • I am not sure if there was ever a difference - I'm assuming hostname was supposed to be the name of host, possibly a remnant from some refactoring. As name is not iterated over in the loop, hostname was in practice the urluparse result of the last name in _server_hosts. And that dict maps hosts to Karabo server names AFAICT, so iterating over hosts here, host is probably the host one would want to know about in the error messages.

    • Please register or sign in to reply
  • Superseded by !93 (merged)

  • closed

  • David Hammer mentioned in merge request !93 (merged)

    mentioned in merge request !93 (merged)

  • Please register or sign in to reply
    Loading