]> git.proxmox.com Git - pve-container.git/commitdiff
PVE::LXC::Config::has_lxc_entry() new helper
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 26 Oct 2016 09:43:59 +0000 (11:43 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 26 Oct 2016 09:45:38 +0000 (11:45 +0200)
src/PVE/LXC/Config.pm

index 2ec643e4230db6d076354b6b7ba4b43b51e6f167..8680ba1de8591ced96973abed4b4a4db6a3c2f0b 100644 (file)
@@ -1135,6 +1135,19 @@ sub has_dev_console {
     return !(defined($conf->{console}) && !$conf->{console});
 }
 
+sub has_lxc_entry {
+    my ($class, $conf, $keyname) = @_;
+
+    if (my $lxcconf = $conf->{lxc}) {
+       foreach my $entry (@$lxcconf) {
+           my ($key, undef) = @$entry;
+           return 1 if $key eq $keyname;
+       }
+    }
+
+    return 0;
+}
+
 sub get_tty_count {
     my ($class, $conf) = @_;