From: Fabian Grünbichler Date: Tue, 5 Jul 2016 08:30:10 +0000 (+0200) Subject: include custom lxc options when displaying config X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=commitdiff_plain;h=8a7783407b3d3e430c1c516764f495f14a2955e1 include custom lxc options when displaying config this makes the "pct config" output more complete, the object returned by the API path contains the lxc options as parsed by our config parser, e.g.: "lxc" : [ [ "lxc.cap.keep", "sys_time" ], [ "lxc.cap.drop", "abc" ], [ "lxc.cap.drop", "" ] ], --- diff --git a/src/PVE/API2/LXC/Config.pm b/src/PVE/API2/LXC/Config.pm index 0d0732e..8597192 100644 --- a/src/PVE/API2/LXC/Config.pm +++ b/src/PVE/API2/LXC/Config.pm @@ -51,7 +51,6 @@ __PACKAGE__->register_method({ my $conf = PVE::LXC::Config->load_config($param->{vmid}); delete $conf->{snapshots}; - delete $conf->{lxc}; return $conf; }}); diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm index b660585..3e99313 100755 --- a/src/PVE/CLI/pct.pm +++ b/src/PVE/CLI/pct.pm @@ -625,12 +625,19 @@ our $cmddef = { my $config = shift; foreach my $k (sort (keys %$config)) { next if $k eq 'digest'; + next if $k eq 'lxc'; my $v = $config->{$k}; if ($k eq 'description') { $v = PVE::Tools::encode_text($v); } print "$k: $v\n"; } + if (defined($config->{'lxc'})) { + my $lxc_list = $config->{'lxc'}; + foreach my $lxc_opt (@$lxc_list) { + print "$lxc_opt->[0]: $lxc_opt->[1]\n" + } + } }], set => [ 'PVE::API2::LXC::Config', 'update_vm', ['vmid'], { node => $nodename }],