Skip to content

Commit

Permalink
vmware_cbt_tool.py: pyVmomi 8.x compatibility
Browse files Browse the repository at this point in the history
-In pyVmomi 8.0 the SmartConnectNoSSL() method was removed.
 This change uses SmartConnect with the disableSslCertValidation=True
 parameter instead. As it was added in pyVmomi 7.0.2 this is now the
 minimum required version, this was added to the documentation.
 backport of #da94e4df3

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
  • Loading branch information
bruno-at-bareos authored and arogge committed Mar 1, 2023
1 parent ead1c4c commit dfca385
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/src/vmware/vmware_cbt_tool/vmware_cbt_tool.py
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# BAREOS - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2014-2020 Bareos GmbH & Co. KG
# Copyright (C) 2014-2023 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -27,7 +27,7 @@

from __future__ import print_function

from pyVim.connect import SmartConnect, SmartConnectNoSSL, Disconnect
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl

import argparse
Expand Down Expand Up @@ -149,7 +149,6 @@ def main():
)

try:

si = None
retry_no_ssl_verify = False
try:
Expand All @@ -172,8 +171,12 @@ def main():

if retry_no_ssl_verify:
try:
si = SmartConnectNoSSL(
host=args.host, user=args.user, pwd=password, port=int(args.port)
si = SmartConnect(
host=args.host,
user=args.user,
pwd=password,
port=int(args.port),
disableSslCertValidation=True,
)
except IOError as e:
print(
Expand Down Expand Up @@ -211,7 +214,6 @@ def main():
vm = None

for vm in get_vm_list(args, dcftree):

print(
"INFO: VM %s CBT supported: %s"
% (
Expand Down

0 comments on commit dfca385

Please sign in to comment.