fog-azure-rm 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/lib/fog/azurerm/custom_fog_errors.rb +18 -0
  4. data/lib/fog/azurerm/utilities/general.rb +5 -5
  5. data/lib/fog/azurerm/version.rb +1 -1
  6. data/test/requests/application_gateway/test_check_ag_exists.rb +1 -1
  7. data/test/requests/application_gateway/test_create_or_update_application_gateway.rb +1 -1
  8. data/test/requests/application_gateway/test_delete_application_gateway.rb +1 -1
  9. data/test/requests/application_gateway/test_get_application_gateway.rb +1 -1
  10. data/test/requests/application_gateway/test_list_application_gateways.rb +1 -1
  11. data/test/requests/application_gateway/test_start_application_gateway.rb +1 -1
  12. data/test/requests/application_gateway/test_stop_application_gateway.rb +1 -1
  13. data/test/requests/compute/test_attach_data_disk_to_vm.rb +4 -4
  14. data/test/requests/compute/test_check_availability_set_exists.rb +1 -1
  15. data/test/requests/compute/test_check_managed_disk_exists.rb +1 -1
  16. data/test/requests/compute/test_check_vm_exists.rb +1 -1
  17. data/test/requests/compute/test_check_vm_extension_exists.rb +1 -1
  18. data/test/requests/compute/test_create_availability_set.rb +2 -2
  19. data/test/requests/compute/test_create_image.rb +1 -1
  20. data/test/requests/compute/test_create_or_update_managed_disk.rb +1 -1
  21. data/test/requests/compute/test_create_virtual_machine.rb +2 -2
  22. data/test/requests/compute/test_create_vm_extension.rb +1 -1
  23. data/test/requests/compute/test_deallocate_virtual_machine.rb +2 -2
  24. data/test/requests/compute/test_delete_availability_set.rb +1 -1
  25. data/test/requests/compute/test_delete_image.rb +1 -1
  26. data/test/requests/compute/test_delete_managed_disk.rb +1 -1
  27. data/test/requests/compute/test_delete_virtual_machine.rb +2 -2
  28. data/test/requests/compute/test_detach_data_disk_from_vm.rb +1 -1
  29. data/test/requests/compute/test_generalize_virtual_machine.rb +2 -2
  30. data/test/requests/compute/test_get_availability_set.rb +1 -1
  31. data/test/requests/compute/test_get_image.rb +1 -1
  32. data/test/requests/compute/test_get_managed_disk.rb +1 -1
  33. data/test/requests/compute/test_get_virtual_machine.rb +1 -1
  34. data/test/requests/compute/test_get_vm_extension.rb +1 -1
  35. data/test/requests/compute/test_get_vm_status.rb +1 -1
  36. data/test/requests/compute/test_grant_access_to_managed_disk.rb +1 -1
  37. data/test/requests/compute/test_list_availability_sets.rb +1 -1
  38. data/test/requests/compute/test_list_available_sizes_for_virtual_machine.rb +2 -2
  39. data/test/requests/compute/test_list_managed_disks_by_rg.rb +1 -1
  40. data/test/requests/compute/test_list_managed_disks_in_subscription.rb +1 -1
  41. data/test/requests/compute/test_list_virtual_machines.rb +1 -1
  42. data/test/requests/compute/test_power_off_virtual_machine.rb +2 -2
  43. data/test/requests/compute/test_redeploy_virtual_machine.rb +2 -2
  44. data/test/requests/compute/test_restart_virtual_machine.rb +2 -2
  45. data/test/requests/compute/test_revoke_access_to_managed_disk.rb +1 -1
  46. data/test/requests/compute/test_start_virtual_machine.rb +2 -2
  47. data/test/requests/compute/test_update_vm_extension.rb +1 -1
  48. data/test/requests/dns/test_check_record_set_exists.rb +1 -1
  49. data/test/requests/dns/test_check_zone_exists.rb +1 -1
  50. data/test/requests/dns/test_create_record_set.rb +1 -1
  51. data/test/requests/dns/test_create_zone.rb +1 -1
  52. data/test/requests/dns/test_delete_record_set.rb +1 -1
  53. data/test/requests/dns/test_delete_zone.rb +1 -1
  54. data/test/requests/dns/test_get_record_set.rb +1 -1
  55. data/test/requests/dns/test_get_records_from_record_set.rb +1 -1
  56. data/test/requests/dns/test_get_zone.rb +1 -1
  57. data/test/requests/dns/test_list_record_sets.rb +1 -1
  58. data/test/requests/dns/test_list_zones.rb +1 -1
  59. data/test/requests/key_vault/test_check_vault_exists.rb +1 -1
  60. data/test/requests/key_vault/test_create_or_update_vault.rb +1 -1
  61. data/test/requests/key_vault/test_delete_vault.rb +1 -1
  62. data/test/requests/key_vault/test_get_vault.rb +1 -1
  63. data/test/requests/key_vault/test_list_vaults.rb +1 -1
  64. data/test/requests/network/test_add_address_prefixes_in_virtual_network.rb +1 -1
  65. data/test/requests/network/test_add_dns_servers_in_virtual_network.rb +1 -1
  66. data/test/requests/network/test_add_subnets_in_virtual_network.rb +1 -1
  67. data/test/requests/network/test_attach_network_security_group_to_subnet.rb +1 -1
  68. data/test/requests/network/test_attach_resource_to_nic.rb +1 -1
  69. data/test/requests/network/test_attach_route_table_to_subnet.rb +1 -1
  70. data/test/requests/network/test_check_express_route_cir_auth_exists.rb +1 -1
  71. data/test/requests/network/test_check_express_route_circuit_exists.rb +1 -1
  72. data/test/requests/network/test_check_load_balancer_exists.rb +1 -1
  73. data/test/requests/network/test_check_local_net_gateway_exists.rb +1 -1
  74. data/test/requests/network/test_check_net_sec_group_exists.rb +1 -1
  75. data/test/requests/network/test_check_net_sec_rule_exists.rb +1 -1
  76. data/test/requests/network/test_check_network_interface_exists.rb +1 -1
  77. data/test/requests/network/test_check_public_ip_exists.rb +1 -1
  78. data/test/requests/network/test_check_subnet_exists.rb +1 -1
  79. data/test/requests/network/test_check_virtual_network_exists.rb +1 -1
  80. data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +1 -1
  81. data/test/requests/network/test_check_vnet_gateway_exists.rb +1 -1
  82. data/test/requests/network/test_create_express_route_circuit.rb +1 -1
  83. data/test/requests/network/test_create_express_route_circuit_authorization.rb +1 -1
  84. data/test/requests/network/test_create_express_route_circuit_peering.rb +1 -1
  85. data/test/requests/network/test_create_load_balancer.rb +1 -1
  86. data/test/requests/network/test_create_local_network_gateway.rb +1 -1
  87. data/test/requests/network/test_create_network_interface.rb +1 -1
  88. data/test/requests/network/test_create_or_update_network_security_group.rb +1 -1
  89. data/test/requests/network/test_create_or_update_network_security_rule.rb +1 -1
  90. data/test/requests/network/test_create_or_update_virtual_network.rb +1 -1
  91. data/test/requests/network/test_create_public_ip.rb +1 -1
  92. data/test/requests/network/test_create_subnet.rb +1 -1
  93. data/test/requests/network/test_create_virtual_network_gateway.rb +1 -1
  94. data/test/requests/network/test_create_virtual_network_gateway_connection.rb +1 -1
  95. data/test/requests/network/test_delete_express_route_circuit.rb +1 -1
  96. data/test/requests/network/test_delete_express_route_circuit_authorization.rb +1 -1
  97. data/test/requests/network/test_delete_express_route_circuit_peering.rb +1 -1
  98. data/test/requests/network/test_delete_load_balancer.rb +1 -1
  99. data/test/requests/network/test_delete_local_network_gateway.rb +1 -1
  100. data/test/requests/network/test_delete_network_interface.rb +1 -1
  101. data/test/requests/network/test_delete_network_security_group.rb +1 -1
  102. data/test/requests/network/test_delete_network_security_rule.rb +1 -1
  103. data/test/requests/network/test_delete_public_ip.rb +1 -1
  104. data/test/requests/network/test_delete_subnet.rb +1 -1
  105. data/test/requests/network/test_delete_virtual_network.rb +1 -1
  106. data/test/requests/network/test_delete_virtual_network_gateway.rb +1 -1
  107. data/test/requests/network/test_delete_virtual_network_gateway_connection.rb +1 -1
  108. data/test/requests/network/test_detach_network_security_group_from_subnet.rb +1 -1
  109. data/test/requests/network/test_detach_resource_from_nic.rb +1 -1
  110. data/test/requests/network/test_detach_route_table_from_subnet.rb +1 -1
  111. data/test/requests/network/test_get_connection_shared_key.rb +1 -1
  112. data/test/requests/network/test_get_express_route_circuit.rb +1 -1
  113. data/test/requests/network/test_get_express_route_circuit_authorization.rb +1 -1
  114. data/test/requests/network/test_get_express_route_circuit_peering.rb +1 -1
  115. data/test/requests/network/test_get_load_balancer.rb +1 -1
  116. data/test/requests/network/test_get_local_network_gateway.rb +1 -1
  117. data/test/requests/network/test_get_network_interface.rb +1 -1
  118. data/test/requests/network/test_get_network_security_group.rb +1 -1
  119. data/test/requests/network/test_get_network_security_rule.rb +1 -1
  120. data/test/requests/network/test_get_public_ip.rb +1 -1
  121. data/test/requests/network/test_get_subnet.rb +1 -1
  122. data/test/requests/network/test_get_virtual_network.rb +1 -1
  123. data/test/requests/network/test_get_virtual_network_gateway.rb +1 -1
  124. data/test/requests/network/test_get_virtual_network_gateway_connection.rb +1 -1
  125. data/test/requests/network/test_list_express_route_circuit_authorizations.rb +1 -1
  126. data/test/requests/network/test_list_express_route_circuit_peerings.rb +1 -1
  127. data/test/requests/network/test_list_express_route_circuits.rb +1 -1
  128. data/test/requests/network/test_list_express_route_service_providers.rb +1 -1
  129. data/test/requests/network/test_list_load_balancers.rb +1 -1
  130. data/test/requests/network/test_list_local_network_gateways.rb +1 -1
  131. data/test/requests/network/test_list_network_interfaces.rb +1 -1
  132. data/test/requests/network/test_list_network_security_groups.rb +1 -1
  133. data/test/requests/network/test_list_network_security_rules.rb +1 -1
  134. data/test/requests/network/test_list_public_ips.rb +1 -1
  135. data/test/requests/network/test_list_subnets.rb +1 -1
  136. data/test/requests/network/test_list_virtual_network_gateway_connections.rb +1 -1
  137. data/test/requests/network/test_list_virtual_network_gateways.rb +1 -1
  138. data/test/requests/network/test_list_virtual_networks.rb +1 -1
  139. data/test/requests/network/test_list_virtual_networks_in_subscription.rb +1 -1
  140. data/test/requests/network/test_remove_address_prefixes_from_virtual_network.rb +1 -1
  141. data/test/requests/network/test_remove_dns_servers_from_virtual_network.rb +1 -1
  142. data/test/requests/network/test_remove_subnets_from_virtual_network.rb +1 -1
  143. data/test/requests/network/test_reset_connection_shared_key.rb +1 -1
  144. data/test/requests/network/test_set_connection_shared_key.rb +1 -1
  145. data/test/requests/network/test_update_public_ip.rb +1 -1
  146. data/test/requests/resources/test_check_deployment_exists.rb +1 -1
  147. data/test/requests/resources/test_check_resource_group_exists.rb +1 -1
  148. data/test/requests/resources/test_create_deployment.rb +1 -1
  149. data/test/requests/resources/test_create_resource_group.rb +1 -1
  150. data/test/requests/resources/test_delete_deployment.rb +1 -1
  151. data/test/requests/resources/test_delete_resource_group.rb +1 -1
  152. data/test/requests/resources/test_delete_resource_tag.rb +1 -1
  153. data/test/requests/resources/test_get_deployment.rb +1 -1
  154. data/test/requests/resources/test_get_resource_group.rb +1 -1
  155. data/test/requests/resources/test_list_deployments.rb +1 -1
  156. data/test/requests/resources/test_list_resource_groups.rb +1 -1
  157. data/test/requests/resources/test_list_tagged_resources.rb +1 -1
  158. data/test/requests/resources/test_tag_resource.rb +1 -1
  159. data/test/requests/sql/test_create_or_update_database.rb +1 -1
  160. data/test/requests/sql/test_create_or_update_firewall_rule.rb +1 -1
  161. data/test/requests/sql/test_create_or_update_sql_server.rb +1 -1
  162. data/test/requests/sql/test_delete_database.rb +1 -1
  163. data/test/requests/sql/test_delete_firewall_rule.rb +1 -1
  164. data/test/requests/sql/test_delete_sql_server.rb +1 -1
  165. data/test/requests/sql/test_get_database.rb +1 -1
  166. data/test/requests/sql/test_get_firewall_rule.rb +1 -1
  167. data/test/requests/sql/test_get_sql_server.rb +1 -1
  168. data/test/requests/sql/test_list_databases.rb +1 -1
  169. data/test/requests/sql/test_list_firewall_rules.rb +1 -1
  170. data/test/requests/sql/test_list_sql_servers.rb +1 -1
  171. data/test/requests/storage/test_acquire_blob_lease.rb +1 -1
  172. data/test/requests/storage/test_acquire_container_lease.rb +1 -1
  173. data/test/requests/storage/test_check_storage_account_exists.rb +1 -1
  174. data/test/requests/storage/test_check_storage_account_name_availability.rb +1 -1
  175. data/test/requests/storage/test_commit_blob_blocks.rb +1 -1
  176. data/test/requests/storage/test_compare_container_blobs.rb +1 -1
  177. data/test/requests/storage/test_copy_blob.rb +1 -1
  178. data/test/requests/storage/test_copy_blob_from_uri.rb +1 -1
  179. data/test/requests/storage/test_create_block_blob.rb +1 -1
  180. data/test/requests/storage/test_create_container.rb +1 -1
  181. data/test/requests/storage/test_create_page_blob.rb +1 -1
  182. data/test/requests/storage/test_create_storage_account.rb +1 -1
  183. data/test/requests/storage/test_delete_blob.rb +1 -1
  184. data/test/requests/storage/test_delete_container.rb +1 -1
  185. data/test/requests/storage/test_delete_storage_account.rb +1 -1
  186. data/test/requests/storage/test_get_blob.rb +3 -3
  187. data/test/requests/storage/test_get_blob_properties.rb +1 -1
  188. data/test/requests/storage/test_get_container_acl.rb +1 -1
  189. data/test/requests/storage/test_get_container_properties.rb +1 -1
  190. data/test/requests/storage/test_get_storage_access_keys.rb +1 -1
  191. data/test/requests/storage/test_get_storage_account.rb +1 -1
  192. data/test/requests/storage/test_list_blobs.rb +1 -1
  193. data/test/requests/storage/test_list_containers.rb +1 -1
  194. data/test/requests/storage/test_list_storage_accounts.rb +1 -1
  195. data/test/requests/storage/test_list_storage_accounts_for_rg.rb +1 -1
  196. data/test/requests/storage/test_put_blob_block.rb +1 -1
  197. data/test/requests/storage/test_put_blob_metadata.rb +1 -1
  198. data/test/requests/storage/test_put_blob_pages.rb +1 -1
  199. data/test/requests/storage/test_put_blob_properties.rb +1 -1
  200. data/test/requests/storage/test_put_container_acl.rb +1 -1
  201. data/test/requests/storage/test_put_container_metadata.rb +1 -1
  202. data/test/requests/storage/test_release_blob_lease.rb +1 -1
  203. data/test/requests/storage/test_release_container_lease.rb +1 -1
  204. data/test/requests/storage/test_update_storage_account.rb +1 -1
  205. data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +1 -1
  206. data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +1 -1
  207. data/test/requests/traffic_manager/test_create_traffic_manager_endpoint.rb +1 -1
  208. data/test/requests/traffic_manager/test_create_traffic_manager_profile.rb +1 -1
  209. data/test/requests/traffic_manager/test_delete_traffic_manager_endpoint.rb +1 -1
  210. data/test/requests/traffic_manager/test_delete_traffic_manager_profile.rb +1 -1
  211. data/test/requests/traffic_manager/test_get_traffic_manager_endpoint.rb +1 -1
  212. data/test/requests/traffic_manager/test_get_traffic_manager_profile.rb +1 -1
  213. data/test/requests/traffic_manager/test_list_traffic_manager_profiles.rb +1 -1
  214. data/test/requests/traffic_manager/test_update_traffic_manager_endpoint.rb +1 -1
  215. data/test/requests/traffic_manager/test_update_traffic_manager_profile.rb +1 -1
  216. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 285effdfb655079d88d06ecd58189657b38a9817cb3eed807cf5bb65c8c68d58
4
- data.tar.gz: d0930b897fcfeb0f1407e8f8a980bd34f0c0222afae5c49d46b2ffe2dbe92a55
3
+ metadata.gz: 4b9efeefac7a938ff930c43843ac651fb93a38af3555b3241ec970f8aca0e412
4
+ data.tar.gz: 3dcbbb882dd381a9b52f174f2c62d48ea6247888033820a7b4084eeb05758cb5
5
5
  SHA512:
6
- metadata.gz: d1aefc7178613404f4ef3638cb08c9fe7326b03b8d2ee165ed650bffe0020bf37e72820de71a872983f02f4deca2b3f92449a94ba07d0f52d790bbecbba29fa1
7
- data.tar.gz: 9fe6cdd1730b11f9aa8235cfcbc55279401072ac46e6c694d15cfcf6d0a715320279ff6bc11e591f37b9ae034f3654004afb0bbd9029afad17cc45be93378696
6
+ metadata.gz: fba09be6a12ab9eb51298ed1ca9ac9a136004c0d1dec6606b4db9ca6125d1eb659c2471f7dc714178f5931f5ca70432d7dfdf2a1f17317ea877296d6f4fcb2f6
7
+ data.tar.gz: 1f6acc0b6182e755ad8d823bd7a9ff9ea91cc9cf92ad595d91df4258df6feb95518e83982cd5d7034547bab2dc81079b4539829d604e40a259ae5f74513d6b9a
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
+ ## 0.4.6
2
+
3
+ **Added:**
4
+ - Created Custom Fog Exceptions
5
+
1
6
  ## 0.4.5
7
+
2
8
  **Changed:**
3
9
  - Updated dependency of fog-json to (~> 1.0.2)
4
10
 
@@ -0,0 +1,18 @@
1
+ # This file contains any or all custom Fog errors that we create
2
+ module Fog
3
+ module AzureRM
4
+ # This is a custom Fog exception inherited from MsRestAzure::AzureOperationError
5
+ class CustomAzureOperationError < MsRestAzure::AzureOperationError
6
+ def initialize(message, azure_exception)
7
+ super(azure_exception.request, azure_exception.response, azure_exception.body, "Exception in #{message}")
8
+ end
9
+ end
10
+
11
+ # This is a custom Fog exception inherited from Azure::Core::Http::HTTPError
12
+ class CustomAzureCoreHttpError < Azure::Core::Http::HTTPError
13
+ def initialize(azure_exception)
14
+ super(azure_exception.http_response)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,5 @@
1
+ require File.expand_path('../../custom_fog_errors.rb', __FILE__)
2
+
1
3
  # Pick Resource Group name from Azure Resource Id(String)
2
4
  def get_resource_group_from_id(id)
3
5
  id.split('/')[4]
@@ -47,11 +49,9 @@ def get_record_type(type)
47
49
  end
48
50
 
49
51
  def raise_azure_exception(exception, msg)
50
- description = exception.is_a?(Azure::Core::Http::HTTPError) ? exception.description : exception.error_message
51
- exception_message = "Exception in #{msg} #{description} Type: #{exception.class}\n#{exception.backtrace.join('\n')}"
52
-
53
- Fog::Logger.debug exception.backtrace
54
- raise exception_message
52
+ raise Fog::AzureRM::CustomAzureCoreHttpError.new(exception) if exception.is_a?(Azure::Core::Http::HTTPError)
53
+ raise Fog::AzureRM::CustomAzureOperationError.new(msg, exception) if exception.is_a?(MsRestAzure::AzureOperationError)
54
+ raise exception
55
55
  end
56
56
 
57
57
  # Make sure if input_params(Hash) contains all keys present in required_params(Array)
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AzureRM
3
- VERSION = '0.4.5'.freeze
3
+ VERSION = '0.4.6'.freeze
4
4
  end
5
5
  end
@@ -32,7 +32,7 @@ class TestCheckAGExists < Minitest::Test
32
32
  def test_check_app_gateway_exists_exception
33
33
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
34
34
  @gateways.stub :get, response do
35
- assert_raises(RuntimeError) { @service.check_ag_exists('fog-test-rg', 'fogRM-rg') }
35
+ assert_raises(MsRestAzure::AzureOperationError) { @service.check_ag_exists('fog-test-rg', 'fogRM-rg') }
36
36
  end
37
37
  end
38
38
  end
@@ -27,7 +27,7 @@ class TestCreateOrUpdateApplicationGateway < Minitest::Test
27
27
  def test_create_or_update_application_gateway_exception_failure
28
28
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
29
29
  @gateways.stub :create_or_update, response do
30
- assert_raises RuntimeError do
30
+ assert_raises MsRestAzure::AzureOperationError do
31
31
  @service.create_or_update_application_gateway(@gateway_params)
32
32
  end
33
33
  end
@@ -17,7 +17,7 @@ class TestDeleteApplicationGateway < Minitest::Test
17
17
  def test_delete_application_gateway_failure
18
18
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
19
19
  @gateways.stub :delete, response do
20
- assert_raises(RuntimeError) { @service.delete_application_gateway('fogRM-rg', 'gateway') }
20
+ assert_raises(MsRestAzure::AzureOperationError) { @service.delete_application_gateway('fogRM-rg', 'gateway') }
21
21
  end
22
22
  end
23
23
  end
@@ -18,7 +18,7 @@ class TestGetApplicationGateway < Minitest::Test
18
18
  def test_get_application_gateway_failure
19
19
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
20
20
  @gateways.stub :get, response do
21
- assert_raises(RuntimeError) { @service.get_application_gateway('fog-test-rg', 'fogRM-rg') }
21
+ assert_raises(MsRestAzure::AzureOperationError) { @service.get_application_gateway('fog-test-rg', 'fogRM-rg') }
22
22
  end
23
23
  end
24
24
  end
@@ -18,7 +18,7 @@ class TestListApplicationGateways < Minitest::Test
18
18
  def test_list_application_gateways_failure
19
19
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
20
20
  @gateways.stub :list_as_lazy, response do
21
- assert_raises(RuntimeError) { @service.list_application_gateways('fogRM-rg') }
21
+ assert_raises(MsRestAzure::AzureOperationError) { @service.list_application_gateways('fogRM-rg') }
22
22
  end
23
23
  end
24
24
  end
@@ -17,7 +17,7 @@ class TestStartApplicationGateway < Minitest::Test
17
17
  def test_start_application_gateway_exception_failure
18
18
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
19
19
  @gateways.stub :start, response do
20
- assert_raises RuntimeError do
20
+ assert_raises MsRestAzure::AzureOperationError do
21
21
  @service.start_application_gateway('test-rg', 'test-ag')
22
22
  end
23
23
  end
@@ -17,7 +17,7 @@ class TestStopApplicationGateway < Minitest::Test
17
17
  def test_stop_application_gateway_exception_failure
18
18
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
19
19
  @gateways.stub :stop, response do
20
- assert_raises RuntimeError do
20
+ assert_raises MsRestAzure::AzureOperationError do
21
21
  @service.stop_application_gateway('test-rg', 'test-ag')
22
22
  end
23
23
  end
@@ -62,7 +62,7 @@ class TestAttachDataDiskToVM < Minitest::Test
62
62
  @virtual_machines.stub :get, @get_vm_response do
63
63
  @storage_accounts.stub :list_keys, @storage_access_keys_response do
64
64
  @virtual_machines.stub :create_or_update, update_vm_response do
65
- assert_raises RuntimeError do
65
+ assert_raises Azure::Core::Http::HTTPError do
66
66
  @service.attach_data_disk_to_vm(@input_params, false)
67
67
  end
68
68
  end
@@ -75,7 +75,7 @@ class TestAttachDataDiskToVM < Minitest::Test
75
75
  @virtual_machines.stub :get, @get_vm_response do
76
76
  @storage_accounts.stub :list_keys, @storage_access_keys_response do
77
77
  @virtual_machines.stub :create_or_update, update_vm_response do
78
- assert_raises RuntimeError do
78
+ assert_raises Azure::Core::Http::HTTPError do
79
79
  @service.attach_data_disk_to_vm(@input_params, false)
80
80
  end
81
81
  end
@@ -86,7 +86,7 @@ class TestAttachDataDiskToVM < Minitest::Test
86
86
  def test_get_vm_failure
87
87
  get_vm_response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
88
88
  @virtual_machines.stub :get, get_vm_response do
89
- assert_raises RuntimeError do
89
+ assert_raises MsRestAzure::AzureOperationError do
90
90
  @service.attach_data_disk_to_vm(@input_params, false)
91
91
  end
92
92
  end
@@ -96,7 +96,7 @@ class TestAttachDataDiskToVM < Minitest::Test
96
96
  storage_access_keys_response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
97
97
  @virtual_machines.stub :get, @get_vm_response do
98
98
  @storage_accounts.stub :list_keys, storage_access_keys_response do
99
- assert_raises RuntimeError do
99
+ assert_raises MsRestAzure::AzureOperationError do
100
100
  @service.attach_data_disk_to_vm(@input_params, false)
101
101
  end
102
102
  end
@@ -32,7 +32,7 @@ class TestCheckAvailabilitySetExists < Minitest::Test
32
32
  def test_check_availability_set_exists_exception
33
33
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
34
34
  @availability_sets.stub :get, response do
35
- assert_raises(RuntimeError) { @service.check_availability_set_exists('myrg1', 'myavset1') }
35
+ assert_raises(MsRestAzure::AzureOperationError) { @service.check_availability_set_exists('myrg1', 'myavset1') }
36
36
  end
37
37
  end
38
38
  end
@@ -32,7 +32,7 @@ class TestCheckManagedDiskExists < Minitest::Test
32
32
  def test_check_managed_disk_exists_exception
33
33
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
34
34
  @managed_disks.stub :get, response do
35
- assert_raises(RuntimeError) { @service.check_managed_disk_exists('myrg1', 'mydisk1') }
35
+ assert_raises(MsRestAzure::AzureOperationError) { @service.check_managed_disk_exists('myrg1', 'mydisk1') }
36
36
  end
37
37
  end
38
38
  end
@@ -32,7 +32,7 @@ class TestCheckVirtualMachineExists < Minitest::Test
32
32
  def test_check_vm_exists_exception
33
33
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
34
34
  @virtual_machines.stub :get, response do
35
- assert_raises(RuntimeError) { @service.check_vm_exists('fog-test-rg', 'fog-test-server', false) }
35
+ assert_raises(MsRestAzure::AzureOperationError) { @service.check_vm_exists('fog-test-rg', 'fog-test-server', false) }
36
36
  end
37
37
  end
38
38
  end
@@ -32,7 +32,7 @@ class TestCheckVMExtensionExists < Minitest::Test
32
32
  def test_check_vm_extension_exists_exception
33
33
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
34
34
  @vm_extension.stub :get, response do
35
- assert_raises(RuntimeError) { @service.check_vm_extension_exists('fog-test-rg', 'fog-test-vm', 'fog-test-extension') }
35
+ assert_raises(MsRestAzure::AzureOperationError) { @service.check_vm_extension_exists('fog-test-rg', 'fog-test-vm', 'fog-test-extension') }
36
36
  end
37
37
  end
38
38
  end
@@ -71,7 +71,7 @@ class TestCreateAvailabilitySet < Minitest::Test
71
71
 
72
72
  @availability_sets.stub :validate_params, true do
73
73
  @availability_sets.stub :create_or_update, response do
74
- assert_raises(RuntimeError) { @service.create_availability_set(avail_set_params) }
74
+ assert_raises(MsRestAzure::AzureOperationError) { @service.create_availability_set(avail_set_params) }
75
75
  end
76
76
  end
77
77
  end
@@ -105,7 +105,7 @@ class TestCreateAvailabilitySet < Minitest::Test
105
105
 
106
106
  @availability_sets.stub :validate_params, true do
107
107
  @availability_sets.stub :create_or_update, response do
108
- assert_raises(RuntimeError) { @service.create_availability_set(avail_set_params) }
108
+ assert_raises(MsRestAzure::AzureOperationError) { @service.create_availability_set(avail_set_params) }
109
109
  end
110
110
  end
111
111
  end
@@ -19,7 +19,7 @@ class TestCreateImage < Minitest::Test
19
19
  def test_create_image_failure
20
20
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
21
21
  @image.stub :create_or_update, response do
22
- assert_raises RuntimeError do
22
+ assert_raises MsRestAzure::AzureOperationError do
23
23
  @service.create_image(@input_params)
24
24
  end
25
25
  end
@@ -31,7 +31,7 @@ class TestCreateManagedDisk < Minitest::Test
31
31
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
32
32
  @managed_disks.stub :validate_params, true do
33
33
  @managed_disks.stub :create_or_update, response do
34
- assert_raises(RuntimeError) { @service.create_or_update_managed_disk(@disk) }
34
+ assert_raises(MsRestAzure::AzureOperationError) { @service.create_or_update_managed_disk(@disk) }
35
35
  end
36
36
  end
37
37
  end
@@ -96,7 +96,7 @@ class TestCreateVirtualMachine < Minitest::Test
96
96
  def test_create_virtual_machine_failure
97
97
  @virtual_machines.stub :create_or_update, @error_response do
98
98
  @virtual_machines.stub :get, @error_response do
99
- assert_raises RuntimeError do
99
+ assert_raises MsRestAzure::AzureOperationError do
100
100
  @service.create_virtual_machine(@linux_virtual_machine_hash)
101
101
  end
102
102
  end
@@ -105,7 +105,7 @@ class TestCreateVirtualMachine < Minitest::Test
105
105
  # Async
106
106
  @virtual_machines.stub :create_or_update_async, @error_response do
107
107
  @virtual_machines.stub :get, @error_response do
108
- assert_raises RuntimeError do
108
+ assert_raises MsRestAzure::AzureOperationError do
109
109
  @service.create_virtual_machine(@linux_virtual_machine_hash, true)
110
110
  end
111
111
  end
@@ -27,7 +27,7 @@ class TestCreateVMExtension < Minitest::Test
27
27
  def test_create_vm_extension_failure
28
28
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
29
29
  @vm_extension.stub :create_or_update, response do
30
- assert_raises RuntimeError do
30
+ assert_raises MsRestAzure::AzureOperationError do
31
31
  @service.create_or_update_vm_extension(@vm_extension_params)
32
32
  end
33
33
  end
@@ -22,11 +22,11 @@ class TestDeallocateVirtualMachine < Minitest::Test
22
22
  def test_deallocate_virtual_machine_failure
23
23
  response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
24
24
  @virtual_machines.stub :deallocate, response do
25
- assert_raises(RuntimeError) { @service.deallocate_virtual_machine('fog-test-rg', 'fog-test-server', false) }
25
+ assert_raises(MsRestAzure::AzureOperationError) { @service.deallocate_virtual_machine('fog-test-rg', 'fog-test-server', false) }
26
26
  end
27
27
 
28
28
  @virtual_machines.stub :deallocate_async, response do
29
- assert_raises(RuntimeError) { @service.deallocate_virtual_machine('fog-test-rg', 'fog-test-server', true) }
29
+ assert_raises(MsRestAzure::AzureOperationError) { @service.deallocate_virtual_machine('fog-test-rg', 'fog-test-server', true) }
30
30
  end
31
31
  end
32
32
  end
@@ -17,7 +17,7 @@ class TestDeleteAvailabilitySet < Minitest::Test
17
17
  def test_delete_availability_set_failure
18
18
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
19
19
  @availability_sets.stub :delete, response do
20
- assert_raises(RuntimeError) { @service.delete_availability_set('fog-test-rg', 'fog-test-as') }
20
+ assert_raises(MsRestAzure::AzureOperationError) { @service.delete_availability_set('fog-test-rg', 'fog-test-as') }
21
21
  end
22
22
  end
23
23
  end
@@ -17,7 +17,7 @@ class TestDeleteImage < Minitest::Test
17
17
  def test_delete_image_failure
18
18
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
19
19
  @image.stub :delete, response do
20
- assert_raises(RuntimeError) { @service.delete_image('fog-test-rg', 'fog-test-server-osImage') }
20
+ assert_raises(MsRestAzure::AzureOperationError) { @service.delete_image('fog-test-rg', 'fog-test-server-osImage') }
21
21
  end
22
22
  end
23
23
  end
@@ -17,7 +17,7 @@ class TestDeleteManagedDisk < Minitest::Test
17
17
  def test_delete_managed_disk_failure
18
18
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
19
19
  @managed_disks.stub :delete, response do
20
- assert_raises(RuntimeError) { @service.delete_managed_disk('fog-test-rg', 'test-disk') }
20
+ assert_raises(MsRestAzure::AzureOperationError) { @service.delete_managed_disk('fog-test-rg', 'test-disk') }
21
21
  end
22
22
  end
23
23
  end
@@ -22,11 +22,11 @@ class TestDeleteVirtualMachine < Minitest::Test
22
22
  def test_delete_virtual_machine_failure
23
23
  response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
24
24
  @virtual_machines.stub :delete, response do
25
- assert_raises(RuntimeError) { @service.delete_virtual_machine('fog-test-rg', 'fog-test-server', false) }
25
+ assert_raises(MsRestAzure::AzureOperationError) { @service.delete_virtual_machine('fog-test-rg', 'fog-test-server', false) }
26
26
  end
27
27
 
28
28
  @virtual_machines.stub :delete_async, response do
29
- assert_raises(RuntimeError) { @service.delete_virtual_machine('fog-test-rg', 'fog-test-server', true) }
29
+ assert_raises(MsRestAzure::AzureOperationError) { @service.delete_virtual_machine('fog-test-rg', 'fog-test-server', true) }
30
30
  end
31
31
  end
32
32
  end
@@ -23,7 +23,7 @@ class TestDetachDataDiskFromVM < Minitest::Test
23
23
  update_vm_response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
24
24
  @virtual_machines.stub :get, get_vm_response do
25
25
  @virtual_machines.stub :create_or_update, update_vm_response do
26
- assert_raises RuntimeError do
26
+ assert_raises MsRestAzure::AzureOperationError do
27
27
  @service.detach_data_disk_from_vm('fog-test-rg', 'fog-test-vm', 'mydatadisk1', false)
28
28
  end
29
29
  end
@@ -22,11 +22,11 @@ class TestGeneralizeVirtualMachine < Minitest::Test
22
22
  def test_generalize_virtual_machine_failure
23
23
  response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
24
24
  @virtual_machines.stub :generalize, response do
25
- assert_raises(RuntimeError) { @service.generalize_virtual_machine('fog-test-rg', 'fog-test-server', false) }
25
+ assert_raises(MsRestAzure::AzureOperationError) { @service.generalize_virtual_machine('fog-test-rg', 'fog-test-server', false) }
26
26
  end
27
27
 
28
28
  @virtual_machines.stub :generalize_async, response do
29
- assert_raises(RuntimeError) { @service.generalize_virtual_machine('fog-test-rg', 'fog-test-server', true) }
29
+ assert_raises(MsRestAzure::AzureOperationError) { @service.generalize_virtual_machine('fog-test-rg', 'fog-test-server', true) }
30
30
  end
31
31
  end
32
32
  end
@@ -18,7 +18,7 @@ class TestGetAvailabilitySet < Minitest::Test
18
18
  def test_list_availability_set_failure
19
19
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
20
20
  @availability_sets.stub :get, response do
21
- assert_raises(RuntimeError) { @service.get_availability_set('myrg1', 'myavset1') }
21
+ assert_raises(MsRestAzure::AzureOperationError) { @service.get_availability_set('myrg1', 'myavset1') }
22
22
  end
23
23
  end
24
24
  end
@@ -17,7 +17,7 @@ class TestGetImage < Minitest::Test
17
17
  def test_get_image_failure
18
18
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
19
19
  @image.stub :get, response do
20
- assert_raises(RuntimeError) { @service.get_image('fog-test-rg', 'TestImage') }
20
+ assert_raises(MsRestAzure::AzureOperationError) { @service.get_image('fog-test-rg', 'TestImage') }
21
21
  end
22
22
  end
23
23
  end
@@ -18,7 +18,7 @@ class TestGetManagedDisk < Minitest::Test
18
18
  def test_get_managed_disk_failure
19
19
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
20
20
  @managed_disks.stub :get, response do
21
- assert_raises(RuntimeError) { @service.get_managed_disk('myrg1', 'disk1') }
21
+ assert_raises(MsRestAzure::AzureOperationError) { @service.get_managed_disk('myrg1', 'disk1') }
22
22
  end
23
23
  end
24
24
  end
@@ -18,7 +18,7 @@ class TestGetVirtualMachine < Minitest::Test
18
18
  def test_get_virtual_machine_failure
19
19
  response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
20
20
  @virtual_machines.stub :get, response do
21
- assert_raises(RuntimeError) { @service.get_virtual_machine('fog-test-rg', 'fog-test-server', false) }
21
+ assert_raises(MsRestAzure::AzureOperationError) { @service.get_virtual_machine('fog-test-rg', 'fog-test-server', false) }
22
22
  end
23
23
  end
24
24
  end
@@ -18,7 +18,7 @@ class TestGetVMExtension < Minitest::Test
18
18
  def test_update_vm_extension_failure
19
19
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
20
20
  @vm_extension.stub :get, response do
21
- assert_raises RuntimeError do
21
+ assert_raises MsRestAzure::AzureOperationError do
22
22
  @service.get_vm_extension('fog-test-rg', 'fog-test-vm', 'fog-test-extension')
23
23
  end
24
24
  end
@@ -19,7 +19,7 @@ class TestGetVirtualMachineStatus < Minitest::Test
19
19
  def test_vm_status_failure
20
20
  response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
21
21
  @virtual_machines.stub :get, response do
22
- assert_raises(RuntimeError) { @service.check_vm_status('fog-test-rg', 'fog-test-server', false) }
22
+ assert_raises(MsRestAzure::AzureOperationError) { @service.check_vm_status('fog-test-rg', 'fog-test-server', false) }
23
23
  end
24
24
  end
25
25
  end
@@ -20,7 +20,7 @@ class TestGrantAccessToManagedDisk < Minitest::Test
20
20
  def test_grant_access_to_managed_disk_failure
21
21
  response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
22
22
  @managed_disks.stub :grant_access, response do
23
- assert_raises(RuntimeError) { @service.grant_access_to_managed_disk('myrg1', 'disk1', 'Read', 100) }
23
+ assert_raises(MsRestAzure::AzureOperationError) { @service.grant_access_to_managed_disk('myrg1', 'disk1', 'Read', 100) }
24
24
  end
25
25
  end
26
26
  end