From b72da462fe73e3f8677f413a0fb78be2eaa05dd0 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Thu, 10 Jul 2025 21:20:36 +0200 Subject: [PATCH] small fixes/improvements arounds ct_templates. --- lib/pve/{templates.rb => ct_templates.rb} | 4 ++-- lib/pve/proxmox/lxc.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename lib/pve/{templates.rb => ct_templates.rb} (98%) diff --git a/lib/pve/templates.rb b/lib/pve/ct_templates.rb similarity index 98% rename from lib/pve/templates.rb rename to lib/pve/ct_templates.rb index 31beaba..1c946d4 100644 --- a/lib/pve/templates.rb +++ b/lib/pve/ct_templates.rb @@ -101,7 +101,7 @@ module PVE::CTTemplate class Datacenter < Base def self.help - <<-EOF.gsub /^ {6}/, '' + <<~EOF Datacenter provides an interface for special network-settings. Networks in Datacenters are often based on this behaviour: A Network has an ID like 99. @@ -180,7 +180,7 @@ module PVE::CTTemplate end def vmid - super || ((0...100).map {|i| "#{100*network_id+i}" } - @virts.map( &:vmid)).first + super || ((0...100).map {|i| "#{100*network_id+i}".to_i } - @virts.map( &:vmid)).first end def network diff --git a/lib/pve/proxmox/lxc.rb b/lib/pve/proxmox/lxc.rb index acd69ce..cb7dd3b 100644 --- a/lib/pve/proxmox/lxc.rb +++ b/lib/pve/proxmox/lxc.rb @@ -4,7 +4,7 @@ require_relative 'exceptions' require_relative 'qemu' require_relative 'task' require_relative 'ha' -require_relative '../../template' +require_relative '../ct_templates' class Proxmox::LXC < Proxmox::Hosted class <