Sha256: 2518d6109001a88b8805173c918e71837721423d310f2f0f47d504a7382b41c1
Contents?: true
Size: 1009 Bytes
Versions: 41
Compression:
Stored size: 1009 Bytes
Contents
module Fog module Compute class Vsphere class Real def destroy_rule(attributes = {}) cluster = get_raw_cluster(attributes[:cluster], attributes[:datacenter]) rule = cluster.configurationEx.rule.find {|rule| rule.key == attributes[:key]} raise Fog::Vsphere::Error::NotFound, "rule #{attributes[:key]} not found" unless rule delete_spec = RbVmomi::VIM.ClusterConfigSpecEx(rulesSpec: [ RbVmomi::VIM.ClusterRuleSpec( operation: RbVmomi::VIM.ArrayUpdateOperation('remove'), removeKey: rule.key ) ]) cluster.ReconfigureComputeResource_Task(spec: delete_spec, modify: true).wait_for_completion end end class Mock def destroy_rule(attributes = {}) rule = self.data[:rules][attributes[:name]] raise Fog::Vsphere::Error::NotFound unless rule self.data[:rules].delete(attributes[:name]) end end end end end
Version data entries
41 entries across 41 versions & 1 rubygems