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 vm_acquire_ticket for webmks console types #9

Merged
Merged
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
10 changes: 10 additions & 0 deletions app/models/manageiq/providers/vmware/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,16 @@ def vm_acquire_mks_ticket(vm, options = {})
end
alias_method :vm_remote_console_mks_acquire_ticket, :vm_acquire_mks_ticket

def vm_acquire_ticket(vm, options = {})
invoke_vim_ws(:acquireTicket, vm, options[:user_event], options[:ticket_type])
end
alias_method :vm_remote_console_acquire_ticket, :vm_acquire_ticket
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this alias? I would rather create a vm_remote_console_webmks_acquire_ticket wrapper with a hardcoded ticket_type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that works, and actually AcquireMksTicket is deprecated as of 4.1 so we can make that a wrapper around this with the mks ticket type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As i look at it, this has probably been done for some symmetry...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I added a method to get webmks tickets specifically so you don't need to pass a :ticket_type in options


def vm_acquire_webmks_ticket(vm, options = {})
vm_acquire_ticket(vm, options.merge(:ticket_type => 'webmks'))
end
alias_method :vm_remote_console_acquire_webmks_ticket, :vm_acquire_webmks_ticket

def vm_add_miq_alarm(vm, _options = {})
result = nil
vm.with_provider_object do |vim_vm|
Expand Down