Fix bmcDumpCreate function

This provides a patch for the dump create function to provide better
messages when errors happen, including when the dump space is full. This
supports the new behavior where the dumps are not automatically
rolled, but require manual deletion before a new entry is created.

Signed-off-by: Justin Thaler <thalerj@us.ibm.com>
Change-Id: I89269e3eb508718fd2bb5ebef97dced8f8da6748
diff --git a/thalerj/openbmctool.py b/thalerj/openbmctool.py
index ef5c69a..4d8b03e 100755
--- a/thalerj/openbmctool.py
+++ b/thalerj/openbmctool.py
@@ -1703,17 +1703,24 @@
     url = 'https://'+host+'/xyz/openbmc_project/dump/action/CreateDump'
     try:
         r = session.post(url, headers=jsonHeader, json = {"data": []}, verify=False, timeout=baseTimeout)
+        info = r.json()
         if(r.status_code == 200 and not args.json):
             return ('Dump successfully created')
         elif(args.json):
-            return r.json()
+            return info
+        elif 'data' in info:
+            if 'QuotaExceeded' in info['data']['description']:
+                return 'BMC dump space is full. Please delete at least one existing dump entry and try again.'
+            else:
+                return "Failed to create a BMC dump. BMC Response:\n {resp}".format(resp=info)
         else:
-            return ('Failed to create dump')
+            return "Failed to create a BMC dump. BMC Response:\n {resp}".format(resp=info)
     except(requests.exceptions.Timeout):
         return connectionErrHandler(args.json, "Timeout", None)
     except(requests.exceptions.ConnectionError) as err:
         return connectionErrHandler(args.json, "ConnectionError", err)
 
+
 def systemDumpRetrieve(host, args, session):
     """
          Downloads system dump