Sha256: ae2a993028641dbcc3a9181c49110c33c0c0c5d95d4ad52d8ee345f95fa27966

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

module Fog
  module Compute
    class AzureRM
      # Real class for Compute Request
      class Real
        def delete_vm_extension(resource_group, vm_name, extension_name)
          msg = "Deleting Extension #{extension_name} of Virtual Machine #{vm_name} in Resource Group #{resource_group}"
          Fog::Logger.debug msg
          begin
            @compute_mgmt_client.virtual_machine_extensions.delete(resource_group, vm_name, extension_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Extension #{extension_name} of Virtual Machine #{vm_name} in Resource Group #{resource_group} deleted successfully"
          true
        end
      end

      # Mock class for Compute Request
      class Mock
        def delete_vm_extension(*)
          Fog::Logger.debug 'Extension extension_name of Virtual Machine vm_name in Resource Group resource_group deleted successfully'
          true
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/requests/compute/delete_vm_extension.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/compute/delete_vm_extension.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/compute/delete_vm_extension.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/compute/delete_vm_extension.rb