fb-vmware 1.6.0__tar.gz → 1.7.0__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 (38) hide show
  1. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/PKG-INFO +1 -1
  2. fb_vmware-1.7.0/data/.gitkeep +0 -0
  3. fb_vmware-1.7.0/data/share/locale/de_DE/LC_MESSAGES/fb_vmware.mo +0 -0
  4. fb_vmware-1.7.0/data/share/locale/en_US/LC_MESSAGES/fb_vmware.mo +0 -0
  5. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/pyproject.toml +1 -0
  6. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/__init__.py +1 -1
  7. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/app/get_host_list.py +5 -2
  8. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/app/get_network_list.py +32 -5
  9. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/app/get_storage_cluster_list.py +8 -5
  10. fb_vmware-1.7.0/src/fb_vmware/app/get_storage_list.py +453 -0
  11. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/app/get_vm_info.py +16 -5
  12. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/app/get_vm_list.py +32 -14
  13. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/cluster.py +34 -2
  14. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/connect.py +333 -79
  15. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/datastore.py +117 -20
  16. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/ds_cluster.py +85 -15
  17. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/dvs.py +103 -48
  18. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/host.py +32 -2
  19. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/network.py +62 -3
  20. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/vm.py +42 -4
  21. fb_vmware-1.6.0/data/share/locale/de_DE/LC_MESSAGES/fb_vmware.mo +0 -0
  22. fb_vmware-1.6.0/data/share/locale/en_US/LC_MESSAGES/fb_vmware.mo +0 -0
  23. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/LICENSE +0 -0
  24. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/README.md +0 -0
  25. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/about.py +0 -0
  26. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/app/__init__.py +0 -0
  27. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/base.py +0 -0
  28. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/config/__init__.py +0 -0
  29. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/controller.py +0 -0
  30. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/dc.py +0 -0
  31. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/disk.py +0 -0
  32. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/errors.py +0 -0
  33. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/ether.py +0 -0
  34. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/host_port_group.py +0 -0
  35. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/iface.py +0 -0
  36. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/obj.py +0 -0
  37. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/typed_dict.py +0 -0
  38. {fb_vmware-1.6.0 → fb_vmware-1.7.0}/src/fb_vmware/xlate.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fb_vmware
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: @summary: The module for a base vSphere handler object.
5
5
  Author-email: Frank Brehm <frank@brehm-online.com>
6
6
  Requires-Python: >=3.8
File without changes
@@ -50,6 +50,7 @@ directory = "data"
50
50
  get-vsphere-host-list = "fb_vmware.app.get_host_list:main"
51
51
  get-vsphere-network-list = "fb_vmware.app.get_network_list:main"
52
52
  get-vsphere-storage-cluster-list = "fb_vmware.app.get_storage_cluster_list:main"
53
+ get-vsphere-storage-list = "fb_vmware.app.get_storage_list:main"
53
54
  get-vsphere-vm-info = "fb_vmware.app.get_vm_info:main"
54
55
  get-vsphere-vm-list = "fb_vmware.app.get_vm_list:main"
55
56
 
@@ -56,7 +56,7 @@ from .vm import VsphereVmList
56
56
  from .xlate import XLATOR
57
57
 
58
58
 
59
- __version__ = "1.6.0"
59
+ __version__ = "1.7.0"
60
60
 
61
61
  LOG = logging.getLogger(__name__)
62
62
 
@@ -29,7 +29,7 @@ from .. import __version__ as GLOBAL_VERSION
29
29
  from ..errors import VSphereExpectedError
30
30
  from ..xlate import XLATOR
31
31
 
32
- __version__ = "1.3.0"
32
+ __version__ = "1.4.0"
33
33
  LOG = logging.getLogger(__name__)
34
34
 
35
35
  _ = XLATOR.gettext
@@ -251,6 +251,7 @@ class GetHostsListApplication(BaseVmwareApplication):
251
251
  summary = {}
252
252
 
253
253
  summary["vsphere"] = host.vsphere
254
+ summary["dc"] = host.dc_name
254
255
  summary["cluster"] = host.cluster_name
255
256
  summary["name"] = host.name
256
257
  summary["connection_state"] = host.connection_state
@@ -279,6 +280,7 @@ class GetHostsListApplication(BaseVmwareApplication):
279
280
  """Print on STDOUT all information about all hosts in a human readable format."""
280
281
  labels = {
281
282
  "vsphere": "vSphere",
283
+ "dc": "DC",
282
284
  "cluster": "Cluster",
283
285
  "name": "Host",
284
286
  "connection_state": _("Connect state"),
@@ -297,6 +299,7 @@ class GetHostsListApplication(BaseVmwareApplication):
297
299
 
298
300
  label_list = (
299
301
  "name",
302
+ "dc",
300
303
  "vsphere",
301
304
  "cluster",
302
305
  "vendor",
@@ -384,7 +387,7 @@ class GetHostsListApplication(BaseVmwareApplication):
384
387
  hosts = []
385
388
 
386
389
  vsphere = self.vsphere[vsphere_name]
387
- vsphere.get_datacenter()
390
+ # vsphere.get_datacenter()
388
391
 
389
392
  re_name = None
390
393
  if self.host_pattern is not None:
@@ -28,7 +28,7 @@ from ..network import GeneralNetworksDict
28
28
  from ..network import VsphereNetwork
29
29
  from ..xlate import XLATOR
30
30
 
31
- __version__ = "1.6.0"
31
+ __version__ = "1.7.0"
32
32
  LOG = logging.getLogger(__name__)
33
33
 
34
34
  _ = XLATOR.gettext
@@ -117,7 +117,7 @@ class GetNetworkListApp(BaseVmwareApplication):
117
117
 
118
118
  vsphere = self.vsphere[vsphere_name]
119
119
  try:
120
- vsphere.get_networks()
120
+ vsphere.get_networks(vsphere_name=vsphere_name)
121
121
 
122
122
  except VSphereExpectedError as e:
123
123
  LOG.error(str(e))
@@ -136,7 +136,7 @@ class GetNetworkListApp(BaseVmwareApplication):
136
136
  LOG.debug(_("Get all network-like objects from vSphere {!r} ...").format(vsphere_name))
137
137
 
138
138
  try:
139
- vsphere.get_networks()
139
+ vsphere.get_networks(vsphere_name=vsphere_name)
140
140
  except VSphereExpectedError as e:
141
141
  LOG.error(str(e))
142
142
  self.exit(6)
@@ -229,8 +229,13 @@ class GetNetworkListApp(BaseVmwareApplication):
229
229
  for uuid in self.vsphere[vsphere_name].dvs.keys():
230
230
  this_dvs = self.vsphere[vsphere_name].dvs[uuid]
231
231
 
232
+ dc_name = "~"
233
+ if this_dvs.dc_name:
234
+ dc_name = this_dvs.dc_name
235
+
232
236
  dvs = {
233
237
  "vsphere": vsphere_name,
238
+ "dc": dc_name,
234
239
  "name": this_dvs.name,
235
240
  "contact": get_contact(this_dvs),
236
241
  "create_time": this_dvs.create_time.isoformat(sep=" ", timespec="seconds"),
@@ -254,6 +259,7 @@ class GetNetworkListApp(BaseVmwareApplication):
254
259
 
255
260
  labels = {
256
261
  "vsphere": "vSphere",
262
+ "dc": _("Data Center"),
257
263
  "name": _("Name"),
258
264
  "contact": _("Contact"),
259
265
  "create_time": _("Creation time"),
@@ -266,6 +272,7 @@ class GetNetworkListApp(BaseVmwareApplication):
266
272
  label_list = (
267
273
  "name",
268
274
  "vsphere",
275
+ "dc",
269
276
  "create_time",
270
277
  "hosts",
271
278
  "ports",
@@ -348,10 +355,20 @@ class GetNetworkListApp(BaseVmwareApplication):
348
355
  if this_dvpg.accessible:
349
356
  accessible = _("Yes")
350
357
 
358
+ dc_name = "~"
359
+ if this_dvpg.dc_name:
360
+ dc_name = this_dvpg.dc_name
361
+
362
+ vlan_id = "~"
363
+ if this_dvpg.vlan_id:
364
+ vlan_id = this_dvpg.vlan_id
365
+
351
366
  dvpg = {
352
367
  "vsphere": vsphere_name,
368
+ "dc": dc_name,
353
369
  "name": name,
354
370
  "dvs": dvs_name,
371
+ "vlan_id": vlan_id,
355
372
  "network": network,
356
373
  "accessible": accessible,
357
374
  "num_ports": "{:,}".format(this_dvpg.num_ports),
@@ -373,8 +390,10 @@ class GetNetworkListApp(BaseVmwareApplication):
373
390
 
374
391
  labels = {
375
392
  "vsphere": "vSphere",
393
+ "dc": "DC",
376
394
  "name": _("Name"),
377
395
  "dvs": "DV Switch",
396
+ "vlan_id": "VLAN ID",
378
397
  "network": _("Network"),
379
398
  "accessible": _("Accessible"),
380
399
  "num_ports": _("Ports"),
@@ -385,7 +404,9 @@ class GetNetworkListApp(BaseVmwareApplication):
385
404
  label_list = (
386
405
  "name",
387
406
  "vsphere",
407
+ "dc",
388
408
  "dvs",
409
+ "vlan_id",
389
410
  "network",
390
411
  "accessible",
391
412
  "type",
@@ -422,7 +443,7 @@ class GetNetworkListApp(BaseVmwareApplication):
422
443
  for label in label_list:
423
444
  if tpl != "":
424
445
  tpl += " "
425
- if label in ("num_ports",):
446
+ if label in ("num_ports", "vlan_id"):
426
447
  tpl += "{{{la}:>{le}}}".format(la=label, le=str_lengths[label])
427
448
  else:
428
449
  tpl += "{{{la}:<{le}}}".format(la=label, le=str_lengths[label])
@@ -458,8 +479,13 @@ class GetNetworkListApp(BaseVmwareApplication):
458
479
  if this_network.accessible:
459
480
  accessible = _("Yes")
460
481
 
482
+ dc_name = "~"
483
+ if this_network.dc_name:
484
+ dc_name = this_network.dc_name
485
+
461
486
  net = {
462
487
  "vsphere": vsphere_name,
488
+ "dc": dc_name,
463
489
  "name": name,
464
490
  "network": network,
465
491
  "accessible": accessible,
@@ -478,11 +504,12 @@ class GetNetworkListApp(BaseVmwareApplication):
478
504
 
479
505
  labels = {
480
506
  "vsphere": "vSphere",
507
+ "dc": _("Data Center"),
481
508
  "name": _("Name"),
482
509
  "network": _("Network"),
483
510
  "accessible": _("Accessible"),
484
511
  }
485
- label_list = ("name", "vsphere", "network", "accessible")
512
+ label_list = ("name", "vsphere", "dc", "network", "accessible")
486
513
 
487
514
  str_lengths = {}
488
515
  for label in labels:
@@ -28,12 +28,11 @@ from fb_tools.xlate import format_list
28
28
  from . import BaseVmwareApplication
29
29
  from . import VmwareAppError
30
30
  from .. import __version__ as GLOBAL_VERSION
31
- # from ..ds_cluster import VsphereDsCluster
32
31
  from ..ds_cluster import VsphereDsClusterDict
33
32
  from ..errors import VSphereExpectedError
34
33
  from ..xlate import XLATOR
35
34
 
36
- __version__ = "1.2.1"
35
+ __version__ = "1.3.1"
37
36
  LOG = logging.getLogger(__name__)
38
37
 
39
38
  _ = XLATOR.gettext
@@ -242,6 +241,7 @@ class GetStorageClusterListApp(BaseVmwareApplication):
242
241
  cluster["cluster_name"] = cluster_name
243
242
 
244
243
  cluster["vsphere_name"] = vsphere_name
244
+ cluster["dc"] = cl.dc_name
245
245
 
246
246
  cluster["capacity"] = cl.capacity_gb
247
247
  cluster["capacity_gb"] = format_decimal(cl.capacity_gb, format="#,##0")
@@ -275,6 +275,7 @@ class GetStorageClusterListApp(BaseVmwareApplication):
275
275
  self.totals = {
276
276
  "cluster_name": _("Total"),
277
277
  "vsphere_name": "",
278
+ "dc": "",
278
279
  "is_total": True,
279
280
  "capacity_gb": format_decimal(total_capacity, format="#,##0"),
280
281
  "free_space_gb": format_decimal(total_free, format="#,##0"),
@@ -314,6 +315,7 @@ class GetStorageClusterListApp(BaseVmwareApplication):
314
315
  labels = {
315
316
  "cluster_name": "Cluster",
316
317
  "vsphere_name": "vSphere",
318
+ "dc": _("Data Center"),
317
319
  "capacity_gb": _("Capacity in GB"),
318
320
  "free_space_gb": _("Free space in GB"),
319
321
  "usage_gb": _("Calculated usage in GB"),
@@ -323,6 +325,7 @@ class GetStorageClusterListApp(BaseVmwareApplication):
323
325
  label_list = (
324
326
  "cluster_name",
325
327
  "vsphere_name",
328
+ "dc",
326
329
  "capacity_gb",
327
330
  "usage_gb",
328
331
  "usage_pc_out",
@@ -349,7 +352,7 @@ class GetStorageClusterListApp(BaseVmwareApplication):
349
352
  for label in label_list:
350
353
  if tpl != "":
351
354
  tpl += " "
352
- if label in ("cluster_name", "vsphere_name"):
355
+ if label in ("cluster_name", "vsphere_name", "dc"):
353
356
  tpl += "{{{la}:<{le}}}".format(la=label, le=field_length[label])
354
357
  else:
355
358
  tpl += "{{{la}:>{le}}}".format(la=label, le=field_length[label])
@@ -383,9 +386,9 @@ class GetStorageClusterListApp(BaseVmwareApplication):
383
386
  if count:
384
387
  msg = ngettext(
385
388
  "Found one VMware storage cluster.",
386
- "Found {} VMware storage clusters.".format(count),
389
+ "Found {} VMware storage clusters.",
387
390
  count,
388
- )
391
+ ).format(count)
389
392
  else:
390
393
  msg = _("No VMware storage clusters found.")
391
394