Skip to content
  • Dimitri Savineau's avatar
    dashboard: update layouts before the restart · eb51cc1b
    Dimitri Savineau authored
    
    
    If the mgr dashboard doesn't restart fast enough then the inject
    dashboard task will fail with a HTTP error 400.
    
    Error EINVAL: Traceback (most recent call last):
      File "/usr/share/ceph/mgr/mgr_module.py", line 914, in _handle_command
        return self.handle_command(inbuf, cmd)
      File "/usr/share/ceph/mgr/dashboard/module.py", line 450, in handle_command
        push_local_dashboards()
      File "/usr/share/ceph/mgr/dashboard/grafana.py", line 132, in push_local_dashboards
        retry()
      File "/usr/share/ceph/mgr/dashboard/grafana.py", line 89, in call
        result = self.func(*self.args, **self.kwargs)
      File "/usr/share/ceph/mgr/dashboard/grafana.py", line 127, in push
        grafana.push_dashboard(body)
      File "/usr/share/ceph/mgr/dashboard/grafana.py", line 54, in push_dashboard
        response.raise_for_status()
      File "/usr/lib/python2.7/site-packages/requests/models.py", line 834, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    HTTPError: 400 Client Error: Bad Request
    
    Instead we can trigger this task before the module restart.
    
    Closes: #4565
    
    Signed-off-by: default avatarDimitri Savineau <dsavinea@redhat.com>
    (cherry picked from commit 3f6ff240)
    eb51cc1b