Skip to content

Commit 985077c

Browse files
committed
Merge pull request #184 from fasrc/fix_onevm_template_id
change onevm provider to use template name not id
2 parents c7eb686 + 2001a6c commit 985077c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • lib/puppet/provider/onevm

lib/puppet/provider/onevm/cli.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ def exists?
4949
def self.instances
5050
vms = Nokogiri::XML(onevm('list','-x')).root.xpath('/VM_POOL/VM')
5151
vms.collect do |vm|
52+
template_id = vm.xpath('./TEMPLATE/TEMPLATE_ID').text
53+
template_name = Nokogiri::XML(onetemplate('show',template_id,'-x')).root.xpath('/VMTEMPLATE/NAME').text
5254
new(
5355
:name => vm.xpath('./NAME').text,
5456
:ensure => :present,
55-
:template => vm.xpath('./TEMPLATE/TEMPLATE_ID').text,
57+
:template => template_name,
5658
:description => vm.xpath('./TEMPLATE/DESCRIPTION').text
5759
)
5860
end

0 commit comments

Comments
 (0)