Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unexpected exception on assigning labels on host networks #892

Merged
merged 1 commit into from
Nov 27, 2023

Commits on Nov 23, 2023

  1. Fix unexpected exception on assigning labels on host networks

    Signed-off-by: Stepan Ermakov <sermakov@orionsoft.ru>
    
    This PR fixes the following issue: an error occurs while assigning labels on host network interfaces: "Error while executing action HostSetupNetworks: Unexpected exception"
    
    Steps to reproduce:
    
        1. Open "Compute->Hosts". List of hosts will be displayed.
        2. Click on any host and select "Network Interfaces" tab. Network interfaces of the selected host will be displayed.
        3. Click on "Setup Host Networks". "Setup Host Networks" modal dialog will be displayed.
        4. Click on "Labels". Labels of the host networks will be displayed.
        5. Drag-n-drop "New Label" on any network interface. Enter new label name and click "OK". New label will be added to the selected network.
        6. Click "OK" in the "Setup Host Networks" modal dialog.
    
    Expected behavior:
        The changes applied with no errors
    Current behavior:
        The error message is displayed: "Error while executing action HostSetupNetworks: Unexpected exception". The new label was not added to the host network.
    
    Background:
        The HostSetupNetworksCommand verifies if there are changes made in the "Setup Host Networks" modal dialog (see HostSetupNetworksCommand.executeCommand, "if (noChangesDetected())" statement).
        Since there are some changes (labels were added) it makes the HostSetupNetworks call to the host VDSM but passes empty payload inside the call (because there were no real changes of networks, just labels were changed). And VDSM fails with the Unexpected Error on the empty payload.
        In this PR I introduced additional check "if (hasNetworkChanges())" that verifies whether the HostSetupNetworks call to the host VDSM is needed or not.
    sermakov-orion committed Nov 23, 2023
    Configuration menu
    Copy the full SHA
    6e8f1e3 View commit details
    Browse the repository at this point in the history