python-chi 1.0.0__tar.gz → 1.0.2__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 (69) hide show
  1. python_chi-1.0.2/ChangeLog +7 -0
  2. {python_chi-1.0.0 → python_chi-1.0.2}/PKG-INFO +1 -1
  3. {python_chi-1.0.0 → python_chi-1.0.2}/chi/hardware.py +4 -4
  4. {python_chi-1.0.0 → python_chi-1.0.2}/chi/lease.py +4 -0
  5. {python_chi-1.0.0 → python_chi-1.0.2}/chi/server.py +5 -3
  6. {python_chi-1.0.0 → python_chi-1.0.2}/python_chi.egg-info/PKG-INFO +1 -1
  7. python_chi-1.0.2/python_chi.egg-info/pbr.json +1 -0
  8. {python_chi-1.0.0 → python_chi-1.0.2}/setup.py +1 -1
  9. python_chi-1.0.0/ChangeLog +0 -7
  10. python_chi-1.0.0/python_chi.egg-info/pbr.json +0 -1
  11. {python_chi-1.0.0 → python_chi-1.0.2}/.github/CODEOWNERS +0 -0
  12. {python_chi-1.0.0 → python_chi-1.0.2}/.github/workflows/pypi-publish.yml +0 -0
  13. {python_chi-1.0.0 → python_chi-1.0.2}/.github/workflows/test.yml +0 -0
  14. {python_chi-1.0.0 → python_chi-1.0.2}/.mailmap +0 -0
  15. {python_chi-1.0.0 → python_chi-1.0.2}/.readthedocs.yml +0 -0
  16. {python_chi-1.0.0 → python_chi-1.0.2}/AUTHORS +0 -0
  17. {python_chi-1.0.0 → python_chi-1.0.2}/DEVELOPMENT.rst +0 -0
  18. {python_chi-1.0.0 → python_chi-1.0.2}/LICENSE +0 -0
  19. {python_chi-1.0.0 → python_chi-1.0.2}/Makefile +0 -0
  20. {python_chi-1.0.0 → python_chi-1.0.2}/README.rst +0 -0
  21. {python_chi-1.0.0 → python_chi-1.0.2}/chi/__init__.py +0 -0
  22. {python_chi-1.0.0 → python_chi-1.0.2}/chi/clients.py +0 -0
  23. {python_chi-1.0.0 → python_chi-1.0.2}/chi/container.py +0 -0
  24. {python_chi-1.0.0 → python_chi-1.0.2}/chi/context.py +0 -0
  25. {python_chi-1.0.0 → python_chi-1.0.2}/chi/exception.py +0 -0
  26. {python_chi-1.0.0 → python_chi-1.0.2}/chi/image.py +0 -0
  27. {python_chi-1.0.0 → python_chi-1.0.2}/chi/jupyterhub.py +0 -0
  28. {python_chi-1.0.0 → python_chi-1.0.2}/chi/keypair.py +0 -0
  29. {python_chi-1.0.0 → python_chi-1.0.2}/chi/magic.py +0 -0
  30. {python_chi-1.0.0 → python_chi-1.0.2}/chi/network.py +0 -0
  31. {python_chi-1.0.0 → python_chi-1.0.2}/chi/share.py +0 -0
  32. {python_chi-1.0.0 → python_chi-1.0.2}/chi/ssh.py +0 -0
  33. {python_chi-1.0.0 → python_chi-1.0.2}/chi/storage.py +0 -0
  34. {python_chi-1.0.0 → python_chi-1.0.2}/chi/util.py +0 -0
  35. {python_chi-1.0.0 → python_chi-1.0.2}/docs/__init__.py +0 -0
  36. {python_chi-1.0.0 → python_chi-1.0.2}/docs/conf.py +0 -0
  37. {python_chi-1.0.0 → python_chi-1.0.2}/docs/generate_notebook.py +0 -0
  38. {python_chi-1.0.0 → python_chi-1.0.2}/docs/index.rst +0 -0
  39. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/clients.rst +0 -0
  40. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/container.rst +0 -0
  41. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/context.rst +0 -0
  42. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/exception.rst +0 -0
  43. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/hardware.rst +0 -0
  44. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/image.rst +0 -0
  45. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/lease.rst +0 -0
  46. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/magic.rst +0 -0
  47. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/network.rst +0 -0
  48. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/server.rst +0 -0
  49. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/share.rst +0 -0
  50. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/ssh.rst +0 -0
  51. {python_chi-1.0.0 → python_chi-1.0.2}/docs/modules/storage.rst +0 -0
  52. {python_chi-1.0.0 → python_chi-1.0.2}/docs/requirements.txt +0 -0
  53. {python_chi-1.0.0 → python_chi-1.0.2}/python_chi.egg-info/SOURCES.txt +0 -0
  54. {python_chi-1.0.0 → python_chi-1.0.2}/python_chi.egg-info/dependency_links.txt +0 -0
  55. {python_chi-1.0.0 → python_chi-1.0.2}/python_chi.egg-info/not-zip-safe +0 -0
  56. {python_chi-1.0.0 → python_chi-1.0.2}/python_chi.egg-info/requires.txt +0 -0
  57. {python_chi-1.0.0 → python_chi-1.0.2}/python_chi.egg-info/top_level.txt +0 -0
  58. {python_chi-1.0.0 → python_chi-1.0.2}/requirements.txt +0 -0
  59. {python_chi-1.0.0 → python_chi-1.0.2}/setup.cfg +0 -0
  60. {python_chi-1.0.0 → python_chi-1.0.2}/test-requirements.txt +0 -0
  61. {python_chi-1.0.0 → python_chi-1.0.2}/tests/__init__.py +0 -0
  62. {python_chi-1.0.0 → python_chi-1.0.2}/tests/test_container.py +0 -0
  63. {python_chi-1.0.0 → python_chi-1.0.2}/tests/test_context.py +0 -0
  64. {python_chi-1.0.0 → python_chi-1.0.2}/tests/test_lease.py +0 -0
  65. {python_chi-1.0.0 → python_chi-1.0.2}/tests/test_network.py +0 -0
  66. {python_chi-1.0.0 → python_chi-1.0.2}/tests/test_server.py +0 -0
  67. {python_chi-1.0.0 → python_chi-1.0.2}/tests/test_share.py +0 -0
  68. {python_chi-1.0.0 → python_chi-1.0.2}/tests/test_ssh.py +0 -0
  69. {python_chi-1.0.0 → python_chi-1.0.2}/tox.ini +0 -0
@@ -0,0 +1,7 @@
1
+ CHANGES
2
+ =======
3
+
4
+ v1.0.2
5
+ ------
6
+
7
+ * Add check for amount when using node\_type
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-chi
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Helper library for Chameleon Infrastructure (CHI) testbed
5
5
  Home-page: https://www.chameleoncloud.org
6
6
  Author: University of Chicago
@@ -180,14 +180,14 @@ def get_nodes(
180
180
 
181
181
  if isinstance(node.gpu, list):
182
182
  gpu_filter = gpu is None or (
183
- node.gpu and gpu == bool(node.gpu[0]["gpu"])
183
+ node.gpu and gpu == bool(node.gpu[0].get("gpu"))
184
184
  )
185
185
  else:
186
- gpu_filter = gpu is None or (node.gpu and gpu == bool(node.gpu["gpu"]))
186
+ gpu_filter = gpu is None or (node.gpu and gpu == bool(node.gpu.get("gpu")))
187
187
 
188
188
  cpu_filter = (
189
189
  min_number_cpu is None
190
- or node.architecture["smt_size"] >= min_number_cpu
190
+ or node.architecture.get("smt_size", 0) >= min_number_cpu
191
191
  )
192
192
 
193
193
  if (
@@ -198,7 +198,7 @@ def get_nodes(
198
198
  ):
199
199
  nodes.append(node)
200
200
 
201
- if node_type not in node_types:
201
+ if node_type is not None and node_type not in node_types:
202
202
  if all_sites:
203
203
  raise exception.CHIValueError(
204
204
  f"Unknown node_type '{node_type}' at all sites."
@@ -308,6 +308,10 @@ class Lease:
308
308
  reservation_list=self.node_reservations, node_name=node.name
309
309
  )
310
310
  else:
311
+ if not amount or not (node_type or node_name):
312
+ raise CHIValueError(
313
+ "You must specify amount and either node_type or node_name"
314
+ )
311
315
  add_node_reservation(
312
316
  reservation_list=self.node_reservations,
313
317
  count=amount,
@@ -595,9 +595,11 @@ def list_flavors() -> List[Flavor]:
595
595
  Returns:
596
596
  A list of all flavors.
597
597
  """
598
- nova_client = nova()
599
- flavors = nova_client.flavors.list()
600
- return [Flavor(name=f.name, disk=f.disk, ram=f.ram, vcpus=f.vcpus) for f in flavors]
598
+ if Version(context.version) >= Version("1.0"):
599
+ nova_client = nova()
600
+ flavors = nova_client.flavors.list()
601
+ return [Flavor(name=f.name, disk=f.disk, ram=f.ram, vcpus=f.vcpus) for f in flavors]
602
+ return nova().flavors.list()
601
603
 
602
604
 
603
605
  def get_flavor(ref) -> NovaFlavor:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-chi
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Helper library for Chameleon Infrastructure (CHI) testbed
5
5
  Home-page: https://www.chameleoncloud.org
6
6
  Author: University of Chicago
@@ -0,0 +1 @@
1
+ {"git_version": "b0c1918", "is_release": false}
@@ -5,5 +5,5 @@ from setuptools import setup
5
5
  setup(
6
6
  setup_requires=["pbr"],
7
7
  pbr=True,
8
- version='v1.0.0'
8
+ version='v1.0.2'
9
9
  )
@@ -1,7 +0,0 @@
1
- CHANGES
2
- =======
3
-
4
- v1.0.0
5
- ------
6
-
7
- * Re-add missing chi imports
@@ -1 +0,0 @@
1
- {"git_version": "16b6624", "is_release": false}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes