Currently renaming the adapter on windows 22 core does not cause an error but also has no effect
INFO cloudbaseinit.plugins.common.networkconfig [-] Renaming network adapter "Ethernet" to "some-adapter-name"
...
ERROR cloudbaseinit.init cloudbaseinit.exception.ItemNotFoundException: Network interface with name "some-adapter-name" not found
Using Win32_NetworkAdapter or netsh for renaming network adapters does not work,
although they do not fail, but do no-operation (probably a Windows bug).
Fixes: https://github.com/cloudbase/cloudbase-init/issues/101
Change-Id: I6b05b313742dd6ff2553dd67b374a8aa4fefd0a7
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
The current latest version of the cloud-init upstream
document URL has changed. Added the latest known good
version for the URL.
Change-Id: Ia2d48bea644a4d78fdf79792451a2f1d4c389f96
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
readthedocs needs a configuration file with the
name .readthedocs.yaml.
See:
https://docs.readthedocs.io/en/stable/config-file/
Change-Id: I594cdb2650322222661b2069128fb4190052f37d
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
... by the new TOX_CONSTRAINTS_FILE env, according to the changes made
in the OpenStack projects.
This also adds the constraints to the doc target, to avoid issues
caused by too new versions being pulled.
Change-Id: I3e99c1c24032cc3f4bc85ab07c28f830122beed4
`pytz` package was included by oslo.log dependency on
oslo.serialization.
Recently, this commit removed the pytz package for
Python versions >= 3.9:
9aaea368e4
Which means `pytz` needs to be added as a requirement to
be able to support the current mainline Python 3.11.
Change-Id: I3dadbe0ead2369565afd7b7feed7761ff4a7db57
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
- add Linux unit testing for Python 3.8 and 3.11 (x64)
- add Windows unit testing for Python 3.8 and 3.11 (x64 and x86)
- add Windows functional testing for Python 3.11 (x64 and x86)
Change-Id: If4ca5a10f62e320c598f0bac7e1ec2ec52862c21
Use the original importer for mock. Otherwise, the unit tests that
use importlib with context are not running in an isolated manner,
leading to various transient failures if `stestr` is not run with the
`--isolated` flag.
The unittest.mock._get_target has been changed in Python 3.11, by commit:
ab7fcc8fbd
This change is needed to add support for Python 3.11 and Python 3.12
unit testing.
Change-Id: Ic73f5280116673f771f5460cdfd3702f5fbe16b5
If `instance_id` is set in the metadata as an integer, cast it as a
string when used to uniquely identify plugin sections.
Fixes-Bug: https://github.com/cloudbase/cloudbase-init/issues/124
Change-Id: I3a9335fb3885c5f3191051aaaeeec94f89a6b89a
The zuul post action seems to not be using the code it just merged, so a
new commit is necessary for the post action code to be used.
Similar to:
https://review.opendev.org/c/starlingx/update/+/879489
Change-Id: I8bd708a08678507f07737f6e3909a93898494682
Use github action ubuntu-22.04 environment to install tox and then run
all tox envs defined in the tox.ini
Change-Id: I7f91314a2b9cd276e63cf2158100795c6bfc8ff3
Match vFAT label using a given label instead of hardcoding 'config-2'.
The NoCloud and ConfigDrive metadata services both attempt to find vFAT
formatted drives but the label used was hardcoded to 'config-2' which
only works with ConfigDrive. BaseConfigDriveService which both inherit
from already has a drive_label property set appropriately for both so
let's use that for the vFAT finding logic as well.
Change-Id: I8004a8565338b0615450bb28cecc86901be94766
Check if the configuration value of bsdtar_path does exist as a path
before trying to execute the binary.
Updated the tutorial reference of bsdtar to FreeBSD instead of Ubuntu.
Change-Id: Ieba5da2f330aa11c40cce6c2ae9de40155f33b07
Use cryptography instead of the flaky openssl libraries loading.
If the libssl DLLs were not present or were present in another order
then the required one, there could be errors when securing the password
before sending it to the metadata service.
Fixes: https://github.com/cloudbase/cloudbase-init/issues/34
Change-Id: I1a2245e199f65f4665071ada9576dcae77a3a432
With Python 3.7+, the Python installer has the libcrypto and libssl dlls
in the DLLs Python folder, namely libcrypto-1_1.dll and libssl-1_1.dll,
which can be used directly.
Change-Id: I245c377dc8a9ec9a2e8548806bacd757bfdf27b6
With Python 3.8, the xml.etree.ElementTree.ElementTree function now
preserves the attribute order specified by the user.
This change broke the winrm enable functionality, throwing the erorr:
```
TypeError: Objects of type 'bytes' can not be converted to Unicode.
```
The fix was to set the correct parameter to return an unicode string and
not bytes.
Change-Id: I10f7fa357267f36dfed03ccb708694f6fc1cdd97
* Added more retries for wireserver discovery
* Added logging to wireserver discovery errors
* Fallback to the well known wireserver IP in case of discovery failure
Github Issue: https://github.com/cloudbase/cloudbase-init/issues/94
Change-Id: I91460f9ad674294a83c9b3c3f05bc04ab61de56f
Python 3.6/3.7 are no longer supported for the latest releasese of
the OpenStack packages like oslo or coverage, thus switching to the Zed
OpenStack release gates, which have support for 3.8/3.9/3.10 Python
versions.
For gates to pass, the docs required a defined language to be set ("en"),
while the crypto unit tests required a method signature fix when running
on Python 3.9/3.10.
The version test__check_latest_version* unit tests started failing
in a transient pattern because of the
pbr.version.VersionInfo().release_string() throwing the following error:
"NotImplementedError: cannot instantiate 'WindowsPath' on your system".
This required to have the cloudbaseinit.version.get_version mocked for a
reliable unit test run on Linux.
Change-Id: I4748d1258c072c377825474e1116347b0a085c56
When a small amount of disk space remains to be extended,
the 'Virtual Disk Service' can fail with
VDS_E_EXTENT_SIZE_LESS_THAN_MIN error code.
This happens on environments where a volume has already been extended
and there is a small amount of bytes that somehow remain residual after
the initial extension.
Change-Id: I072ed568ef1f2790e95851b45afb8ffcc0acce0e
Fixed Windows osutils DHCP setting, as the former implementation that
used registry keys was no reliable. Using MSFT_NetIPInterface should fix
any reliability issues.
Change-Id: I94cf70b092da706cdfaf57bc78d7b266064b97b0
Allows giving an instance an individual cloud username, e.g. for license servers, while still retrieving SSH public keys for that user from OpenStack.
Change-Id: I078380ef8f74b30105fd44378045df8b1260acbc
On Windows, the load user profile may fail on laggy systems, if the
Windows subsystems are not ready at that moment.
Retrying the load should fix the issue most of the times.
Change-Id: I28cc564ebeac6d901dcbbef7cebe882a5ccb41b1
The WMI implementation for NETLBFO is sometimes flaky and does not fail
when a bond cannot be created.
Added 5 retries for the team creation, just in case the WMI call to
create the bond did not fail, but the bond was not created.
In this scenario, the _wait_for_nic method is called and it fails,
as it does not find the team nic and the retry is performed.
Updated the wait for team nic retry interval to 10 seconds,
as the team nic may be retrieved with WMI after a longer time.
Change-Id: I7622a4a30b867f335ed8f3288ca2fea830daf94b
Removed the functools partial from being mocked, as it is used
internally in the mocking implementation and generates unit test error.
Updated tox / unit test requirements according to new OpenStack gate
requirements.
Updating the tox requirements added a new set of flakes rules that had
to be skipped for now, which will be addressed in upcoming patches.
Change-Id: I231ca3b15313541e2c43785e80d9db5659aa1cc3
As Python 2 has reached EOL, is time to remove the declarative support
for it. This code snapshot still supports Python 2.7, but in the future,
no Python 2.x tests will be performed to ensure the support.
Change-Id: Ic8fe6b958d658ae25f887179ab5900e13c88af54
Move baseopenstackservice._ip_netmask_to_cidr to utils/network so that
it can be reused by other network parsers.
Change-Id: Iacca02cda75fd5d5b80f6200e7d2f26a3381b737
It is necessary to catch yaml and json errors that come from invalid
json / yaml streams like '{}}'.
Having an enumeration after a key value was set is a yaml parser error.
Change-Id: Ia8b298c3f1b36c6dee29326955d1e76ade3104b1