Skip to content

Commit

Permalink
Review Comment on String Interpolation
Browse files Browse the repository at this point in the history
After review comments the snapshot name composition has
been changed from string concatenation to string interpolation.
  • Loading branch information
jerryk55 committed Aug 31, 2017
1 parent 8f8c68a commit c005b0d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/manageiq/providers/azure/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class ManageIQ::Providers::Azure::CloudManager < ManageIQ::Providers::CloudManag
before_create :ensure_managers
before_update :ensure_managers_zone_and_provider_region

SSA_SNAPSHOT_SUFFIX = "__EVM__SSA__SNAPSHOT"

# If the Microsoft.Insights Azure provider is not registered, then neither
# events nor metrics are supported for that EMS.
#
Expand Down Expand Up @@ -129,7 +131,7 @@ def vm_create_evm_snapshot(vm, options = {})
:sourceResourceId => os_disk.managed_disk.id
}
} }
snap_name = os_disk.name + "__EVM__SSA__SNAPSHOT"
snap_name = "#{os_disk.name}#{SSA_SNAPSHOT_SUFFIX}"
_log.debug("vm=[#{vm.name}] creating SSA snapshot #{snap_name}")
begin
snap_svc.get(snap_name, vm.resource_group)
Expand All @@ -153,7 +155,7 @@ def vm_delete_evm_snapshot(vm, options = {})
snap_svc = snapshot_service(conf)
vm_obj = vm_svc.get(vm.name, vm.resource_group)
os_disk = vm_obj.properties.storage_profile.os_disk
snap_name = os_disk.name + "__EVM__SSA__SNAPSHOT"
snap_name = "#{os_disk.name}#{SSA_SNAPSHOT_SUFFIX}"
_log.debug("vm=[#{vm.name}] deleting SSA snapshot #{snap_name}")
snap_svc.delete(snap_name, vm.resource_group)
rescue => err
Expand Down

0 comments on commit c005b0d

Please sign in to comment.