Hello,
This is the call:
Tagging.create(tag_id,vm.id)`
And this the result:
NoMethodError: undefined method `stringify_keys' for 1000000000181:Fixnum
Thanks!
Here the code:
vm_name = "dfghjkoiuyt56789-1"
vm = VmOrTemplate.find_by_name(vm_name)
cloud_id = vm.ems_id
tenant_id = vm.cloud_tenant_id
cloud = EmsOpenstack.find_by_id(cloud_id)
tenant_name = cloud.cloud_tenants.find_by_id(tenant_id).name
correct_tag = (cloud.name + '_' + tenant_name).downcase
if Tag.find_by_classification_name('tenant/'+correct_tag).nil?
puts "Tag doesn't exist, ignoring."
else
tag_defined = 1
vm.tags.each do |tag|
if tag.name == '/managed/tenant/' + correct_tag
tag_defined = 0
return
end
end
if tag_defined == 1
tag_id = Tag.find_by_classification_name('/tenant/' + correct_tag)['id']
Tagging.create(tag_id,vm.id)
end
end