From ca5afdfcb29de35b0499599a1de5bd61a950af2e Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 5 Jan 2010 23:52:20 -0800 Subject: [PATCH] Handle new capped-cpu output format --- zones/zones-lib.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zones/zones-lib.pl b/zones/zones-lib.pl index 14593f9dd..56675864b 100755 --- a/zones/zones-lib.pl +++ b/zones/zones-lib.pl @@ -10,6 +10,8 @@ use WebminCore; %thing_key_map = ( "net" => "address", "fs" => "dir", "inherit-pkg-dir" => "dir", + "capped-cpu" => "ncpus", + "capped-memory" => "physical", "rctl" => "name", "attr" => "name", "device" => "match" ); @@ -64,7 +66,8 @@ foreach $p ("zonepath", "autoboot", "pool", "brand") { } # Add lists of things -foreach $r ("fs", "inherit-pkg-dir", "net", "device", "rctl", "attr") { +foreach $r ("fs", "inherit-pkg-dir", "net", "device", "rctl", "attr", + "capped-cpu", "capped-memory") { local @lines = &get_zonecfg_output($zone, "info $r"); local ($l, $thing); foreach $l (@lines) { @@ -75,9 +78,11 @@ foreach $r ("fs", "inherit-pkg-dir", "net", "device", "rctl", "attr") { 'keyzone' => $zone }; push(@{$zinfo->{$r}}, $thing); } - elsif ($l =~ /^\s+([^:]+):\s*\[(.*)\]/ || - $l =~ /^\s+([^:]+):\s*"(.*)"/ || - $l =~ /^\s+([^:]+):\s*(.*)/) { + elsif ($l =~ /^\s+\[([^:]+):\s*"(.*)"\]/ || + $l =~ /^\s+\[([^:]+):\s*(.*)\]/ || + $l =~ /^\s+([^:]+):\s*\[(.*)\]/ || + $l =~ /^\s+([^:]+):\s*"(.*)"/ || + $l =~ /^\s+([^:]+):\s*(.*)/) { # An attribute of a thing if (defined($thing->{$1})) { # Multiple values!