Skip to content

Commit 37cc468

Browse files
authored
Merge pull request bareos#2341
VMware Plugin: Adapt to pyVmomi 9
2 parents cb37560 + b2f4cdc commit 37cc468

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5252
- stored: add new volume status 'Unlabeled' [PR #2207]
5353
- doc: add views & functions to developer catalog service chapter [PR #2328]
5454
- systemtests: add config-default test [PR #2332]
55+
- VMware Plugin: Adapt to pyVmomi 9 [PR #2341]
5556

5657
### Documentation
5758
- docs: fix grpc-fd plugin call [PR #2068]
@@ -193,4 +194,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
193194
[PR #2321]: https://github.com/bareos/bareos/pull/2321
194195
[PR #2328]: https://github.com/bareos/bareos/pull/2328
195196
[PR #2332]: https://github.com/bareos/bareos/pull/2332
197+
[PR #2341]: https://github.com/bareos/bareos/pull/2341
196198
[unreleased]: https://github.com/bareos/bareos/tree/master

core/src/plugins/filed/python/vmware/bareos-fd-vmware.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@
5151
from pyVmomi import vim
5252
from pyVmomi import vmodl
5353
import pyVim.task
54-
from pyVmomi.VmomiSupport import VmomiJSONEncoder
54+
55+
# Try import pyVmomi 9.x first and fallback to old method
56+
try:
57+
from pyVmomi.VmomiJSONEncoder import VmomiJSONEncoder
58+
except ImportError:
59+
from pyVmomi.VmomiSupport import VmomiJSONEncoder
5560

5661
# if OrderedDict is not available from collection (eg. SLES11),
5762
# the additional package python-ordereddict must be used

0 commit comments

Comments
 (0)