Sha256: 9461d8c01f99527e6cede6e331a1e809eae4c2cf89a3d585cf3007ced865622d
Contents?: true
Size: 1.21 KB
Versions: 23
Compression:
Stored size: 1.21 KB
Contents
module Fog module Vsphere class Compute 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 = data[:rules][attributes[:name]] raise Fog::Vsphere::Error::NotFound unless rule data[:rules].delete(attributes[:name]) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems