[noctool-cvs] CVS source

imattsson imattsson at common-lisp.net
Fri Aug 29 17:29:47 UTC 2008


Update of /project/noctool/cvsroot/source
In directory clnet:/tmp/cvs-serv3420

Modified Files:
	tests.lisp 
Log Message:
IM

Unbroke PARSE-GOBBLE when handed a split list starting with a digit field.


--- /project/noctool/cvsroot/source/tests.lisp	2008/08/27 18:06:59	1.7
+++ /project/noctool/cvsroot/source/tests.lisp	2008/08/29 17:29:45	1.8
@@ -31,6 +31,7 @@
 		      (if (>= (alert-level monitor) *alerting*) 5 1)))))))))
 
 (defgeneric process-disk (monitor host))
+(defgeneric process-df (host pty))
 
 (defun parse-gobble (list)
   (let* ((pos 0)
@@ -39,7 +40,8 @@
 		     while (not (parse-integer element :junk-allowed t))
 		     do (setf pos lpos)
 		     collect element)))
-    (cons (format nil "~{~a~^ ~}" first) (subseq list pos))))
+    (cond ((zerop pos) list)
+	  (t (cons (format nil "~{~a~^ ~}" first) (subseq list pos))))))
 
 (defun parse-df (pty)
   "parse output from df from the given pty"
@@ -63,6 +65,9 @@
            (setf last NIL)))
     ret))
 
+(defmethod process-df (host pty)
+  (declare (ignore host))
+  (parse-df pty))
 
 (defmethod process-disk ((monitor disk-container) (host linux-host))
   (with-pty (pty (make-ssh-command "df" (address host) (username host)))




More information about the noctool-cvs mailing list