mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Add missing return
libpod df handler missing a return after writing error to client. This caused a null to be appended to JSON and crashed python decoder. Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
@ -72,6 +72,7 @@ func DiskUsage(w http.ResponseWriter, r *http.Request) {
|
||||
response, err := ic.SystemDf(r.Context(), options)
|
||||
if err != nil {
|
||||
utils.InternalServerError(w, err)
|
||||
return
|
||||
}
|
||||
utils.WriteResponse(w, http.StatusOK, response)
|
||||
}
|
||||
|
@ -727,6 +727,10 @@ class TestApi(unittest.TestCase):
|
||||
start = json.loads(r.text)
|
||||
self.assertGreater(len(start["Errs"]), 0, r.text)
|
||||
|
||||
def test_df(self):
|
||||
r = requests.get(_url("/system/df"))
|
||||
self.assertEqual(r.status_code, 200, r.text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user