-
Notifications
You must be signed in to change notification settings - Fork 767
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major pyVmomi update for vSphere 8.0
# Breaking changes: - Minimum Python 2 requirement is 2.7.9 - DynamicTypeManagerHelper.py is removed - ManagedMethodExecutorHelper.py is removed - connect.ConnectNoSSL() and connect.SmartConnectNoSSL() are removed. Use connect.Connect(disableSslCertValidation=True) and connect.SmartConnect(disableSslCertValidation=True) - VmomiSupport.UncallableManagedMethod is renamed to VmomiSupport.UnknownManagedMethod # New modules: Security.py A new module is added to handle thumbprint verification. There is a predefined set of available crypto functions to verify the certificate thumbprints. Its possible to configure during runtime which of the available crypto functions are allowed. Feature.py A new module related to pyVmomi development within VMware. VmomiJSONEncoder.py The VmomiJSONEncoder is moved into a dedicated module. # More changes: - A new 'binaryIsBytearray' setting is added to select the base type for the binary type. By default, the binary type is 'str' for Python 2 and 'bytes' for Python 3. If binaryIsBytearray is True, the binary type for Python 2 is set to 'bytearray'. Required for VmomiJSONEncoder to work properly. - The license note is removed from the Python files. LICENSE.txt holds the Apache 2 license note. - pyVmomi now uses relative imports - Dependency on “requests” is removed - Added support for SAML token authentication - Added timeout for HTTP requests - Added option to set the maximum amount of time a task is allowed to run. On timeout, an exception is generated if raiseOnError is True. - Add option to get all updates for the task. - Add option to use a logger instead of the standard output - Various bug fixes - Code style improvements # Deprecated: - connect.OpenUrlWithBasicAuth() - connect.OpenPathWithStub()
- Loading branch information
ddraganov
committed
Nov 24, 2022
1 parent
b9129d9
commit a90023f
Showing
22 changed files
with
5,610 additions
and
5,202 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,30 @@ | ||
# VMware vSphere Python SDK | ||
# Copyright (c) 2008-2015 VMware, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" | ||
Copyright (c) 2008-2022 VMware, Inc. | ||
This module implements the cache decorator | ||
""" | ||
__author__ = "VMware, Inc." | ||
__author__ = "VMware, Inc" | ||
|
||
|
||
def Cache(fn): | ||
""" Function cache decorator """ | ||
def fnCache(*args, **kwargs): | ||
""" Cache function """ | ||
key = (args and tuple(args) or None, | ||
kwargs and frozenset(kwargs.items()) or None) | ||
if key not in fn.__cached__: | ||
fn.__cached__[key] = cache = fn(*args, **kwargs) | ||
else: | ||
cache = fn.__cached__[key] | ||
return cache | ||
""" Function cache decorator """ | ||
def fnCache(*args, **kwargs): | ||
""" Cache function """ | ||
key = (args and tuple(args) | ||
or None, kwargs and frozenset(list(kwargs.items())) or None) | ||
if key not in fn.__cached__: | ||
fn.__cached__[key] = cache = fn(*args, **kwargs) | ||
else: | ||
cache = fn.__cached__[key] | ||
return cache | ||
|
||
def ResetCache(): | ||
""" Reset cache """ | ||
fn.__cached__ = {} | ||
def ResetCache(): | ||
""" Reset cache """ | ||
fn.__cached__ = {} | ||
|
||
setattr(fn, "__cached__", {}) | ||
setattr(fn, "__resetcache__", ResetCache) | ||
fnCache.__name__ = fn.__name__ | ||
fnCache.__doc__ = fn.__doc__ | ||
fnCache.__dict__.update(fn.__dict__) | ||
return fnCache | ||
setattr(fn, "__cached__", {}) | ||
setattr(fn, "__resetcache__", ResetCache) | ||
fnCache.__name__ = fn.__name__ | ||
fnCache.__doc__ = fn.__doc__ | ||
fnCache.__dict__.update(fn.__dict__) | ||
return fnCache |
Oops, something went wrong.
a90023f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, have you considered removing them from the tests too? :/
a90023f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We are currently reviewing stale issues and pull requests in both pyVmomi and the community samples projects and tests will be handled after that.