Skip to content

Commit

Permalink
fix json return
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Oct 20, 2022
1 parent 4cf0f34 commit 3044490
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/saltext/vmware/modules/vm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import json
import logging

import salt.exceptions
Expand All @@ -11,7 +12,7 @@
log = logging.getLogger(__name__)

try:
from pyVmomi import vim
from pyVmomi import vim, VmomiSupport

HAS_PYVMOMI = True
except ImportError:
Expand Down Expand Up @@ -678,4 +679,4 @@ def get_mks_ticket(vm_name, ticket_type, service_instance=None, profile=None):
vm_ref = utils_common.get_mor_by_property(service_instance, vim.VirtualMachine, vm_name)
ticket = vm_ref.AcquireTicket(ticket_type)

return {"host": ticket.host, "ticket": ticket.ticket}
return json.loads(json.dumps(ticket, cls=VmomiSupport.VmomiJSONEncoder))

0 comments on commit 3044490

Please sign in to comment.