nix-community / nixops-vbox

NixOps VirtualBox backend [maintainer=@AmineChikhaoui]
GNU Lesser General Public License v3.0
22 stars 15 forks source link

be robust to malformed `showvminfo` output #32

Open mxw opened 2 years ago

mxw commented 2 years ago

recent versions of mac os x virtualbos seem to include a sort of section header for recording screen properties, which causes vm creation to fatal because it's not in the expected k=v format. let's just skip over these lines.

fixes #31

mattoxb commented 2 years ago

I wonder though if it would be just slightly more efficient to do something like

parts = line.split("=", 1)
if len(parts) < 2:
  continue
(k,v) = parts