Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to rename a VM #17658

Merged
merged 1 commit into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/mixins/supports_feature_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ module SupportsFeatureMixin
:remove_security_group => 'Remove Security Group',
:remove_snapshot => 'Remove Snapshot',
:remove_snapshot_by_description => 'Remove snapshot having a description',
:rename => 'Rename a VM',
:reset => 'Reset',
:resize => 'Resizing',
:retire => 'Retirement',
Expand Down
11 changes: 11 additions & 0 deletions app/models/vm_or_template/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ def vm_destroy
check_policy_prevent(:request_vm_destroy, :raw_destroy)
end

def raw_rename(new_name)
unless ext_management_system
raise _("VM has no Provider, unable to renamey VM")
end
run_command_via_parent(:vm_rename, :new_name => new_name)
end

def rename(new_name)
raw_rename(new_name)
end

private

#
Expand Down