openshift-python-wrapper 4.11.59__tar.gz → 4.11.61__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. {openshift-python-wrapper-4.11.59/openshift_python_wrapper.egg-info → openshift_python_wrapper-4.11.61}/PKG-INFO +24 -10
  2. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/node.py +3 -6
  3. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/node_network_configuration_policy.py +22 -11
  4. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_restore.py +1 -2
  5. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_snapshot.py +1 -2
  6. openshift_python_wrapper-4.11.61/pyproject.toml +61 -0
  7. openshift-python-wrapper-4.11.59/PKG-INFO +0 -174
  8. openshift-python-wrapper-4.11.59/VERSION +0 -1
  9. openshift-python-wrapper-4.11.59/openshift_python_wrapper.egg-info/SOURCES.txt +0 -139
  10. openshift-python-wrapper-4.11.59/openshift_python_wrapper.egg-info/dependency_links.txt +0 -1
  11. openshift-python-wrapper-4.11.59/openshift_python_wrapper.egg-info/requires.txt +0 -5
  12. openshift-python-wrapper-4.11.59/openshift_python_wrapper.egg-info/top_level.txt +0 -1
  13. openshift-python-wrapper-4.11.59/pyproject.toml +0 -47
  14. openshift-python-wrapper-4.11.59/setup.cfg +0 -4
  15. openshift-python-wrapper-4.11.59/tests/test_resources.py +0 -36
  16. openshift-python-wrapper-4.11.59/tests/test_validate_resources.py +0 -159
  17. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/LICENSE +0 -0
  18. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/README.md +0 -0
  19. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/__init__.py +0 -0
  20. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/api_service.py +0 -0
  21. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/backup.py +0 -0
  22. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/benchmark.py +0 -0
  23. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/catalog_source.py +0 -0
  24. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/catalog_source_config.py +0 -0
  25. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/cdi.py +0 -0
  26. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/cdi_config.py +0 -0
  27. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/chaos_engine.py +0 -0
  28. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/chaos_result.py +0 -0
  29. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_operator.py +0 -0
  30. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_role.py +0 -0
  31. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_role_binding.py +0 -0
  32. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_service_version.py +0 -0
  33. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_version.py +0 -0
  34. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/configmap.py +0 -0
  35. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/console_cli_download.py +0 -0
  36. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/console_plugin.py +0 -0
  37. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/console_quick_start.py +0 -0
  38. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/constants.py +0 -0
  39. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/csidriver.py +0 -0
  40. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/custom_resource_definition.py +0 -0
  41. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/daemonset.py +0 -0
  42. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/data_import_cron.py +0 -0
  43. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/data_source.py +0 -0
  44. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/datavolume.py +0 -0
  45. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/deployment.py +0 -0
  46. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/destination_rule.py +0 -0
  47. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/event.py +0 -0
  48. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/forklift_controller.py +0 -0
  49. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/gateway.py +0 -0
  50. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/hook.py +0 -0
  51. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/host.py +0 -0
  52. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/hostpath_provisioner.py +0 -0
  53. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/hyperconverged.py +0 -0
  54. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/image.py +0 -0
  55. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/image_content_source_policy.py +0 -0
  56. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/image_stream.py +0 -0
  57. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/imagestreamtag.py +0 -0
  58. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/infrastructure.py +0 -0
  59. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/installplan.py +0 -0
  60. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/job.py +0 -0
  61. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/kube_descheduler.py +0 -0
  62. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt.py +0 -0
  63. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_common_templates_bundle.py +0 -0
  64. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_metrics_aggregation.py +0 -0
  65. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_node_labeller_bundle.py +0 -0
  66. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_template_validaotr.py +0 -0
  67. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/logger.py +0 -0
  68. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/machine.py +0 -0
  69. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_config.py +0 -0
  70. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_config_pool.py +0 -0
  71. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_health_check.py +0 -0
  72. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_set.py +0 -0
  73. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/migration.py +0 -0
  74. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/migration_policy.py +0 -0
  75. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/mtv.py +0 -0
  76. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/mutating_webhook_config.py +0 -0
  77. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/namespace.py +0 -0
  78. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/network.py +0 -0
  79. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/network_addons_config.py +0 -0
  80. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/network_attachment_definition.py +0 -0
  81. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/network_map.py +0 -0
  82. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/network_policy.py +0 -0
  83. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/nmstate.py +0 -0
  84. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/node_health_check.py +0 -0
  85. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/node_maintenance.py +0 -0
  86. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/node_network_configuration_enactment.py +0 -0
  87. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/node_network_state.py +0 -0
  88. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/oauth.py +0 -0
  89. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_condition.py +0 -0
  90. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_group.py +0 -0
  91. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_hub.py +0 -0
  92. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_source.py +0 -0
  93. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/package_manifest.py +0 -0
  94. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/peer_authentication.py +0 -0
  95. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/persistent_volume.py +0 -0
  96. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/persistent_volume_claim.py +0 -0
  97. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/plan.py +0 -0
  98. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/pod.py +0 -0
  99. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/pod_disruption_budget.py +0 -0
  100. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/priority_class.py +0 -0
  101. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/project.py +0 -0
  102. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/prometheus.py +0 -0
  103. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/prometheus_rule.py +0 -0
  104. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/provider.py +0 -0
  105. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/replicaset.py +0 -0
  106. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/resource.py +0 -0
  107. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/restore.py +0 -0
  108. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/role.py +0 -0
  109. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/role_binding.py +0 -0
  110. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/route.py +0 -0
  111. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/secret.py +0 -0
  112. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/security_context_constraints.py +0 -0
  113. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/service.py +0 -0
  114. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/service_account.py +0 -0
  115. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/service_mesh_control_plane.py +0 -0
  116. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/service_mesh_member_roll.py +0 -0
  117. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/service_monitor.py +0 -0
  118. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/sriov_network.py +0 -0
  119. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/sriov_network_node_policy.py +0 -0
  120. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/sriov_network_node_state.py +0 -0
  121. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/ssp.py +0 -0
  122. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_class.py +0 -0
  123. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_map.py +0 -0
  124. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_profile.py +0 -0
  125. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/subscription.py +0 -0
  126. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/tekton_tasks.py +0 -0
  127. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/template.py +0 -0
  128. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/upload_token_request.py +0 -0
  129. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/utils.py +0 -0
  130. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/validating_webhook_config.py +0 -0
  131. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine.py +0 -0
  132. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_Instance_replica_set.py +0 -0
  133. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_cluster_flavor.py +0 -0
  134. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_flavor.py +0 -0
  135. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_import.py +0 -0
  136. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_instance.py +0 -0
  137. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_instance_migration.py +0 -0
  138. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_instance_preset.py +0 -0
  139. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_service.py +0 -0
  140. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/vm_import_config.py +0 -0
  141. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/volume_snapshot.py +0 -0
  142. {openshift-python-wrapper-4.11.59 → openshift_python_wrapper-4.11.61}/ocp_resources/volume_snapshot_class.py +0 -0
@@ -1,18 +1,31 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openshift-python-wrapper
3
- Version: 4.11.59
4
- Summary: Wrapper around https://github.com/openshift/openshift-restclient-python
5
- Author-email: Meni Yakove <myakove@gmail.com>, Ruth Netser <rnetser@gmail.com>
6
- Project-URL: Homepage, https://github.com/RedHatQE/openshift-python-wrapper
7
- Project-URL: Download, https://pypi.org/project/openshift-python-wrapper/
8
- Project-URL: Bug Tracker, https://github.com/RedHatQE/openshift-python-wrapper/issues
9
- Project-URL: Documentation, https://openshift-python-wrapper.readthedocs.io/en/latest/
3
+ Version: 4.11.61
4
+ Summary: Wrapper around https://github.com/kubernetes-client/python
5
+ Home-page: https://github.com/RedHatQE/openshift-python-wrapper
6
+ License: Apache-2.0
10
7
  Keywords: Openshift,Kubevirt,CNV
11
- Classifier: Programming Language :: Python :: 3
8
+ Author: Meni Yakove
9
+ Author-email: myakove@gmail.com
10
+ Requires-Python: >=3.8,<4.0
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.7
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Requires-Dist: colorlog (>=6.7.0,<7.0.0)
19
+ Requires-Dist: kubernetes (>=27.2.0,<28.0.0)
20
+ Requires-Dist: openshift (>=0.13.2,<0.14.0)
21
+ Requires-Dist: packaging (>=23.1,<24.0)
22
+ Requires-Dist: python-benedict (>=0.32.0,<0.33.0)
23
+ Requires-Dist: python-simple-logger (>=1.0.5,<2.0.0)
24
+ Requires-Dist: xmltodict (>=0.13.0,<0.14.0)
25
+ Project-URL: Bug Tracker, https://github.com/RedHatQE/openshift-python-wrapper/issues
26
+ Project-URL: Documentation, https://openshift-python-wrapper.readthedocs.io/en/latest/
27
+ Project-URL: Download, https://pypi.org/project/openshift-python-wrapper/
14
28
  Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
29
 
17
30
  # openshift-python-wrapper
18
31
  Pypi: [openshift-python-wrapper](https://pypi.org/project/openshift-python-wrapper)
@@ -172,3 +185,4 @@ We use pre-commit for code check.
172
185
  ```bash
173
186
  pre-commit install
174
187
  ```
188
+
@@ -15,12 +15,9 @@ class Node(Resource):
15
15
  @property
16
16
  def kubelet_ready(self):
17
17
  return any(
18
- [
19
- stat
20
- for stat in self.instance.status.conditions
21
- if stat["reason"] == "KubeletReady"
22
- and stat["status"] == self.Condition.Status.TRUE
23
- ]
18
+ stat["reason"] == "KubeletReady"
19
+ and stat["status"] == self.Condition.Status.TRUE
20
+ for stat in self.instance.status.conditions
24
21
  )
25
22
 
26
23
  @property
@@ -12,6 +12,10 @@ from ocp_resources.resource import Resource, ResourceEditor
12
12
  from ocp_resources.utils import TimeoutExpiredError, TimeoutSampler
13
13
 
14
14
 
15
+ IPV4_STR = "ipv4"
16
+ IPV6_STR = "ipv6"
17
+
18
+
15
19
  class NNCPConfigurationFailed(Exception):
16
20
  pass
17
21
 
@@ -214,30 +218,30 @@ class NodeNetworkConfigurationPolicy(Resource):
214
218
  }
215
219
  if set_ipv4:
216
220
  if isinstance(set_ipv4, str):
217
- iface["ipv4"] = set_ipv4
221
+ iface[IPV4_STR] = set_ipv4
218
222
 
219
223
  else:
220
- iface["ipv4"] = {
224
+ iface[IPV4_STR] = {
221
225
  "enabled": ipv4_enable,
222
226
  "dhcp": ipv4_dhcp,
223
227
  "auto-dns": ipv4_auto_dns,
224
228
  }
225
229
  if ipv4_addresses:
226
- iface["ipv4"]["address"] = ipv4_addresses
230
+ iface[IPV4_STR]["address"] = ipv4_addresses
227
231
 
228
232
  if set_ipv6:
229
233
  if isinstance(set_ipv6, str):
230
- iface["ipv6"] = set_ipv6
234
+ iface[IPV6_STR] = set_ipv6
231
235
 
232
236
  else:
233
- iface["ipv6"] = {
237
+ iface[IPV6_STR] = {
234
238
  "enabled": ipv6_enable,
235
239
  "dhcp": ipv6_dhcp,
236
240
  "auto-dns": ipv6_auto_dns,
237
241
  "autoconf": ipv6_autoconf,
238
242
  }
239
243
  if ipv6_addresses:
240
- iface["ipv6"]["address"] = ipv6_addresses
244
+ iface[IPV6_STR]["address"] = ipv6_addresses
241
245
 
242
246
  self.set_interface(interface=iface)
243
247
  return self.res
@@ -254,13 +258,20 @@ class NodeNetworkConfigurationPolicy(Resource):
254
258
  for port in self.ports:
255
259
  _port = self._get_port_from_nns(port_name=port)
256
260
  if _port:
257
- self.ipv4_ports_backup_dict[port] = _port[ip_family]
261
+ if ip_family == IPV4_STR:
262
+ self.ipv4_ports_backup_dict[port] = _port[ip_family]
263
+ elif ip_family == IPV6_STR:
264
+ self.ipv6_ports_backup_dict[port] = _port[ip_family]
265
+ else:
266
+ raise ValueError(
267
+ f"'ip_family' must be either '{IPV4_STR}' or '{IPV6_STR}'"
268
+ )
258
269
 
259
270
  def ipv4_ports_backup(self):
260
- self._ports_backup(ip_family="ipv4")
271
+ self._ports_backup(ip_family=IPV4_STR)
261
272
 
262
273
  def ipv6_ports_backup(self):
263
- self._ports_backup(ip_family="ipv6")
274
+ self._ports_backup(ip_family=IPV6_STR)
264
275
 
265
276
  def add_ports(self):
266
277
  for port in self.ports:
@@ -275,10 +286,10 @@ class NodeNetworkConfigurationPolicy(Resource):
275
286
  "state": _port["state"],
276
287
  }
277
288
  if ipv4_backup:
278
- iface["ipv4"] = ipv4_backup
289
+ iface[IPV4_STR] = ipv4_backup
279
290
 
280
291
  if ipv6_backup:
281
- iface["ipv6"] = ipv6_backup
292
+ iface[IPV6_STR] = ipv6_backup
282
293
 
283
294
  self.set_interface(interface=iface)
284
295
 
@@ -69,8 +69,7 @@ class VirtualMachineRestore(NamespacedResource):
69
69
  wait_timeout=timeout,
70
70
  sleep=1,
71
71
  exceptions_dict=PROTOCOL_ERROR_EXCEPTION_DICT,
72
- func=lambda: self.instance.get("status", {}).get("complete", None)
73
- == status,
72
+ func=lambda: self.instance.get("status", {}).get("complete") == status,
74
73
  )
75
74
  for sample in samples:
76
75
  if sample:
@@ -66,8 +66,7 @@ class VirtualMachineSnapshot(NamespacedResource):
66
66
  wait_timeout=timeout,
67
67
  sleep=1,
68
68
  exceptions_dict=PROTOCOL_ERROR_EXCEPTION_DICT,
69
- func=lambda: self.instance.get("status", {}).get("readyToUse", None)
70
- == status,
69
+ func=lambda: self.instance.get("status", {}).get("readyToUse") == status,
71
70
  )
72
71
  for sample in samples:
73
72
  if sample:
@@ -0,0 +1,61 @@
1
+ [tool.black]
2
+ line-length = 88
3
+ target_version = ['py37', 'py38', 'py39', 'py310', "py311"]
4
+ exclude = '''
5
+ (
6
+ /(
7
+ | \.git
8
+ | \.venv
9
+ | \.mypy_cache
10
+ | \.tox
11
+ )/
12
+ )
13
+ '''
14
+
15
+ [tool.isort]
16
+ line_length = 88
17
+ profile = "black"
18
+
19
+ [tool.poetry]
20
+ name = "openshift-python-wrapper"
21
+ version = "4.11.61"
22
+ description = "Wrapper around https://github.com/kubernetes-client/python"
23
+ authors = ["Meni Yakove <myakove@gmail.com>", "Ruth Netser <rnetser@gmail.com>"]
24
+ readme = "README.md"
25
+ license = "Apache-2.0"
26
+ packages = [{include = "ocp_resources"}]
27
+ homepage = "https://github.com/RedHatQE/openshift-python-wrapper"
28
+ documentation = "https://openshift-python-wrapper.readthedocs.io/en/latest/"
29
+ keywords = ["Openshift", "Kubevirt", "CNV"]
30
+ classifiers = [
31
+ "Programming Language :: Python :: 3",
32
+ "Operating System :: OS Independent",
33
+ ]
34
+
35
+ [tool.poetry.urls]
36
+ Download = "https://pypi.org/project/openshift-python-wrapper/"
37
+ "Bug Tracker" = "https://github.com/RedHatQE/openshift-python-wrapper/issues"
38
+
39
+ [tool.poetry.group.dev.dependencies]
40
+ ipdb = "^0.13.13"
41
+
42
+ [tool.poetry-dynamic-versioning.substitution]
43
+ files = ["VERSION"]
44
+
45
+ [tool.poetry-dynamic-versioning]
46
+ enable = false
47
+ pattern = "((?P<epoch>\\d+)!)?(?P<base>\\d+(\\.\\d+)*)"
48
+
49
+ [build-system]
50
+ requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
51
+ build-backend = "poetry_dynamic_versioning.backend"
52
+
53
+ [tool.poetry.dependencies]
54
+ python = "^3.8"
55
+ openshift = "^0.13.2"
56
+ xmltodict = "^0.13.0"
57
+ colorlog = "^6.7.0"
58
+ kubernetes = "^27.2.0"
59
+ python-benedict = "^0.32.0"
60
+ packaging = "^23.1"
61
+ python-simple-logger = "^1.0.5"
@@ -1,174 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: openshift-python-wrapper
3
- Version: 4.11.59
4
- Summary: Wrapper around https://github.com/openshift/openshift-restclient-python
5
- Author-email: Meni Yakove <myakove@gmail.com>, Ruth Netser <rnetser@gmail.com>
6
- Project-URL: Homepage, https://github.com/RedHatQE/openshift-python-wrapper
7
- Project-URL: Download, https://pypi.org/project/openshift-python-wrapper/
8
- Project-URL: Bug Tracker, https://github.com/RedHatQE/openshift-python-wrapper/issues
9
- Project-URL: Documentation, https://openshift-python-wrapper.readthedocs.io/en/latest/
10
- Keywords: Openshift,Kubevirt,CNV
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.7
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
-
17
- # openshift-python-wrapper
18
- Pypi: [openshift-python-wrapper](https://pypi.org/project/openshift-python-wrapper)
19
- A python wrapper for [openshift-restclient-python](https://github.com/openshift/openshift-restclient-python) with support for RedHat Container Virtualization. ([Openshift Virtualization](https://www.openshift.com/learn/topics/virtualization))
20
- Docs: [openshift-python-wrapper docs](https://openshift-python-wrapper.readthedocs.io/en/latest/)
21
-
22
- ## Installation
23
- From source:
24
- ```bash
25
- git clone https://github.com/RedHatQE/openshift-python-wrapper.git
26
- cd openshift-python-wrapper
27
- python setup.py install --user
28
- ```
29
- From pypi:
30
- ```bash
31
- pip install openshift-python-wrapper --user
32
- ```
33
-
34
- ## Release new version
35
- ### requirements:
36
- * Export GitHub token
37
- ```bash
38
- export GITHUB_TOKEN=<your_github_token>
39
- ```
40
- * [release-it](https://github.com/release-it/release-it)
41
- ```bash
42
- sudo npm install --global release-it
43
- npm install --save-dev @release-it/bumper
44
- ```
45
- ### usage:
46
- * Create a release, run from the relevant branch.
47
- To create a 4.11 release, run:
48
- ```bash
49
- git checkout v4.11
50
- git pull
51
- release-it # Follow the instructions
52
- ```
53
-
54
- ## docs
55
- Hosted on readthedocs.io [openshift-python-wrapper](https://openshift-python-wrapper.readthedocs.io/en/latest/)
56
-
57
- ## PR dependency
58
- For PR dependency we use [dpulls](https://www.dpulls.com/)
59
- To make PR depends on other PR add `depends on #<PR NUMBER>` in the PR description.
60
-
61
- ## Logging configuration
62
- To change log level export OPENSHIFT_PYTHON_WRAPPER_LOG_LEVEL:
63
-
64
- ```bash
65
- export OPENSHIFT_PYTHON_WRAPPER_LOG_LEVEL=<LOG_LEVEL> # can be: "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"
66
- ```
67
-
68
- ## Examples
69
- ### Client
70
- ```python
71
- client = DynamicClient(client=kubernetes.config.new_client_from_config())
72
- ```
73
- The examples given below are relevant to all resources. For simplicity we will use the resource - Namespace.
74
- ### Import
75
- Import Namespace:
76
- ```python
77
- from resources.namespace import Namespace
78
- ```
79
- ### Create
80
- Create a Namespace:
81
- ```python
82
- ns = Namespace(name="namespace-example-1")
83
- ns.create()
84
- ```
85
- Will return ``True`` if creation succeeded.
86
-
87
- We can also use the ``with`` statement which ensures automatic clean-up of the code executed:
88
- ```python
89
- with Namespace(name="namespace-example-2") as ns:
90
- yield ns
91
- ```
92
- ``teardown=False`` - Disables clean-up after execution.
93
- ### Wait
94
- Wait for Namespace to be in status ``Active``:
95
- ```python
96
- ns.wait_for_status(status=Namespace.Status.ACTIVE, timeout=120)
97
- ```
98
- Will raise a ``TimeoutExpiredError`` if Namespace is not in the desired status.
99
- ### Delete
100
- Delete the Namespace
101
- ```python
102
- ns.delete()
103
- ```
104
- Will return ``False`` if not found.
105
- ### Exists
106
- Checks if Namespace exists on the server:
107
- ```python
108
- ns.exists
109
- ```
110
- Will return ``None`` if not found.
111
- ### Get
112
- Query to get Pods (resource) in the connected cluster with label of ``label_example=example``. Returns a ``generator`` of the resource - ``pod``
113
- ```python
114
- for pod in Pod.get(dyn_client=client, label_selector="label_example=example")):
115
- pod.log()
116
- ```
117
- We can also get the name of the Node that the ``pod`` is running on:
118
- ```python
119
- pod.node.name
120
- ```
121
- ### VM
122
- Start:
123
- ```python
124
- with VirtualMachine(
125
- name="vm-example",
126
- namespace="namespace-example",
127
- node_selector="worker-node-example",
128
- ) as vm:
129
- vm.start()
130
- ```
131
- Stop:
132
- ```python
133
- vm.stop()
134
- ```
135
- Restart:
136
- ```python
137
- vm.restart()
138
- ```
139
- Get VMI:
140
- ```python
141
- test_vmi = vm.vmi
142
- ```
143
- After having a VMI, we can wait until VMI is in running state:
144
- ```python
145
- test_vmi.wait_until_running()
146
- ```
147
- Will raise ``TimeoutExpiredError`` if VMI failed to run.
148
-
149
- Then, we can get the Pod that is in Running state and execute a command on it:
150
- ```python
151
- command_output = test_vmi.virt_launcher_pod.execute(command="command-example")
152
- ```
153
- If no Pod was found, will raise ``ResourceNotFoundError``.
154
-
155
- ### NNCP Capture Syntax
156
- Using capture syntax to switch ipv4 config between interfaces
157
- ```python
158
- with NodeNetworkConfigurationPolicy(
159
- name="capture_nncp",
160
- capture={'first-nic': 'interfaces.name=="ens8"',
161
- 'second-nic': 'interfaces.name=="ens9"'},
162
- teardown=False, # Capture doesn't support reverting config on teardown
163
- ...
164
- ) as nncp:
165
- nncp.add_interface(name="{{ capture.first-nic.interfaces.0.name }}", set_ipv4="{{ capture.second-nic.interfaces.0.ipv4 }}")
166
- nncp.add_interface(name="{{ capture.second-nic.interfaces.0.name }}", set_ipv4="{{ capture.first-nic.interfaces.0.ipv4 }}")
167
- yield nncp
168
- ```
169
-
170
- ## Code check
171
- We use pre-commit for code check.
172
- ```bash
173
- pre-commit install
174
- ```
@@ -1 +0,0 @@
1
- 4.11.59
@@ -1,139 +0,0 @@
1
- LICENSE
2
- README.md
3
- VERSION
4
- pyproject.toml
5
- ocp_resources/__init__.py
6
- ocp_resources/api_service.py
7
- ocp_resources/backup.py
8
- ocp_resources/benchmark.py
9
- ocp_resources/catalog_source.py
10
- ocp_resources/catalog_source_config.py
11
- ocp_resources/cdi.py
12
- ocp_resources/cdi_config.py
13
- ocp_resources/chaos_engine.py
14
- ocp_resources/chaos_result.py
15
- ocp_resources/cluster_operator.py
16
- ocp_resources/cluster_role.py
17
- ocp_resources/cluster_role_binding.py
18
- ocp_resources/cluster_service_version.py
19
- ocp_resources/cluster_version.py
20
- ocp_resources/configmap.py
21
- ocp_resources/console_cli_download.py
22
- ocp_resources/console_plugin.py
23
- ocp_resources/console_quick_start.py
24
- ocp_resources/constants.py
25
- ocp_resources/csidriver.py
26
- ocp_resources/custom_resource_definition.py
27
- ocp_resources/daemonset.py
28
- ocp_resources/data_import_cron.py
29
- ocp_resources/data_source.py
30
- ocp_resources/datavolume.py
31
- ocp_resources/deployment.py
32
- ocp_resources/destination_rule.py
33
- ocp_resources/event.py
34
- ocp_resources/forklift_controller.py
35
- ocp_resources/gateway.py
36
- ocp_resources/hook.py
37
- ocp_resources/host.py
38
- ocp_resources/hostpath_provisioner.py
39
- ocp_resources/hyperconverged.py
40
- ocp_resources/image.py
41
- ocp_resources/image_content_source_policy.py
42
- ocp_resources/image_stream.py
43
- ocp_resources/imagestreamtag.py
44
- ocp_resources/infrastructure.py
45
- ocp_resources/installplan.py
46
- ocp_resources/job.py
47
- ocp_resources/kube_descheduler.py
48
- ocp_resources/kubevirt.py
49
- ocp_resources/kubevirt_common_templates_bundle.py
50
- ocp_resources/kubevirt_metrics_aggregation.py
51
- ocp_resources/kubevirt_node_labeller_bundle.py
52
- ocp_resources/kubevirt_template_validaotr.py
53
- ocp_resources/logger.py
54
- ocp_resources/machine.py
55
- ocp_resources/machine_config.py
56
- ocp_resources/machine_config_pool.py
57
- ocp_resources/machine_health_check.py
58
- ocp_resources/machine_set.py
59
- ocp_resources/migration.py
60
- ocp_resources/migration_policy.py
61
- ocp_resources/mtv.py
62
- ocp_resources/mutating_webhook_config.py
63
- ocp_resources/namespace.py
64
- ocp_resources/network.py
65
- ocp_resources/network_addons_config.py
66
- ocp_resources/network_attachment_definition.py
67
- ocp_resources/network_map.py
68
- ocp_resources/network_policy.py
69
- ocp_resources/nmstate.py
70
- ocp_resources/node.py
71
- ocp_resources/node_health_check.py
72
- ocp_resources/node_maintenance.py
73
- ocp_resources/node_network_configuration_enactment.py
74
- ocp_resources/node_network_configuration_policy.py
75
- ocp_resources/node_network_state.py
76
- ocp_resources/oauth.py
77
- ocp_resources/operator_condition.py
78
- ocp_resources/operator_group.py
79
- ocp_resources/operator_hub.py
80
- ocp_resources/operator_source.py
81
- ocp_resources/package_manifest.py
82
- ocp_resources/peer_authentication.py
83
- ocp_resources/persistent_volume.py
84
- ocp_resources/persistent_volume_claim.py
85
- ocp_resources/plan.py
86
- ocp_resources/pod.py
87
- ocp_resources/pod_disruption_budget.py
88
- ocp_resources/priority_class.py
89
- ocp_resources/project.py
90
- ocp_resources/prometheus.py
91
- ocp_resources/prometheus_rule.py
92
- ocp_resources/provider.py
93
- ocp_resources/replicaset.py
94
- ocp_resources/resource.py
95
- ocp_resources/restore.py
96
- ocp_resources/role.py
97
- ocp_resources/role_binding.py
98
- ocp_resources/route.py
99
- ocp_resources/secret.py
100
- ocp_resources/security_context_constraints.py
101
- ocp_resources/service.py
102
- ocp_resources/service_account.py
103
- ocp_resources/service_mesh_control_plane.py
104
- ocp_resources/service_mesh_member_roll.py
105
- ocp_resources/service_monitor.py
106
- ocp_resources/sriov_network.py
107
- ocp_resources/sriov_network_node_policy.py
108
- ocp_resources/sriov_network_node_state.py
109
- ocp_resources/ssp.py
110
- ocp_resources/storage_class.py
111
- ocp_resources/storage_map.py
112
- ocp_resources/storage_profile.py
113
- ocp_resources/subscription.py
114
- ocp_resources/tekton_tasks.py
115
- ocp_resources/template.py
116
- ocp_resources/upload_token_request.py
117
- ocp_resources/utils.py
118
- ocp_resources/validating_webhook_config.py
119
- ocp_resources/virtual_machine.py
120
- ocp_resources/virtual_machine_Instance_replica_set.py
121
- ocp_resources/virtual_machine_cluster_flavor.py
122
- ocp_resources/virtual_machine_flavor.py
123
- ocp_resources/virtual_machine_import.py
124
- ocp_resources/virtual_machine_instance.py
125
- ocp_resources/virtual_machine_instance_migration.py
126
- ocp_resources/virtual_machine_instance_preset.py
127
- ocp_resources/virtual_machine_restore.py
128
- ocp_resources/virtual_machine_snapshot.py
129
- ocp_resources/virtual_service.py
130
- ocp_resources/vm_import_config.py
131
- ocp_resources/volume_snapshot.py
132
- ocp_resources/volume_snapshot_class.py
133
- openshift_python_wrapper.egg-info/PKG-INFO
134
- openshift_python_wrapper.egg-info/SOURCES.txt
135
- openshift_python_wrapper.egg-info/dependency_links.txt
136
- openshift_python_wrapper.egg-info/requires.txt
137
- openshift_python_wrapper.egg-info/top_level.txt
138
- tests/test_resources.py
139
- tests/test_validate_resources.py
@@ -1,5 +0,0 @@
1
- openshift
2
- xmltodict
3
- urllib3
4
- colorlog
5
- packaging
@@ -1,47 +0,0 @@
1
- [tool.black]
2
- line-length = 88
3
-
4
- [build-system]
5
- requires = ["setuptools>=61.2"]
6
- build-backend = "setuptools.build_meta"
7
-
8
- [project]
9
- name = "openshift-python-wrapper"
10
- authors = [
11
- {name = "Meni Yakove", email = "myakove@gmail.com"},
12
- {name = "Ruth Netser", email = "rnetser@gmail.com"}
13
- ]
14
- description = "Wrapper around https://github.com/openshift/openshift-restclient-python"
15
- classifiers = [
16
- "Programming Language :: Python :: 3",
17
- "Operating System :: OS Independent",
18
- ]
19
- requires-python = ">=3.7"
20
- keywords = ["Openshift", "Kubevirt", "CNV"]
21
- dependencies = [
22
- "openshift",
23
- "xmltodict",
24
- "urllib3",
25
- "colorlog",
26
- "packaging",
27
- ]
28
- dynamic = ["version"]
29
- # ...
30
- [tool.setuptools.dynamic]
31
- version = {file = "VERSION"}
32
-
33
- [project.readme]
34
- file = "README.md"
35
- content-type = "text/markdown"
36
-
37
- [project.urls]
38
- Homepage = "https://github.com/RedHatQE/openshift-python-wrapper"
39
- Download = "https://pypi.org/project/openshift-python-wrapper/"
40
- "Bug Tracker" = "https://github.com/RedHatQE/openshift-python-wrapper/issues"
41
- Documentation = "https://openshift-python-wrapper.readthedocs.io/en/latest/"
42
-
43
- [tool.setuptools]
44
- include-package-data = true
45
-
46
- [tool.setuptools.packages.find]
47
- include = ["ocp_resources"]
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
@@ -1,36 +0,0 @@
1
- import kubernetes
2
- import pytest
3
- from openshift.dynamic import DynamicClient
4
-
5
- from ocp_resources.namespace import Namespace
6
- from ocp_resources.pod import Pod
7
- from ocp_resources.virtual_machine import VirtualMachine
8
- from tests.utils import generate_yaml_from_template
9
-
10
-
11
- @pytest.fixture(scope="session")
12
- def client():
13
- return DynamicClient(client=kubernetes.config.new_client_from_config())
14
-
15
-
16
- @pytest.fixture(scope="session")
17
- def namespace():
18
- with Namespace(name="namespace-for-tests") as ns:
19
- yield ns
20
-
21
-
22
- def test_get(client):
23
- Pod.get(dyn_client=client)
24
-
25
-
26
- def test_create():
27
- with Namespace(name="test-namespace"):
28
- pass
29
-
30
-
31
- def test_vm(namespace):
32
- name = "test-vm"
33
- with VirtualMachine(
34
- name=name, namespace=namespace.name, body=generate_yaml_from_template(name=name)
35
- ):
36
- pass