osi-dump 0.1.3.1.3__py3-none-any.whl → 0.1.3.1.5__py3-none-any.whl

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.
osi_dump/api/octavia.py CHANGED
@@ -34,4 +34,6 @@ def get_amphoraes(connection: Connection, load_balancer_id: str) -> list[dict]:
34
34
 
35
35
  amphoraes = data["amphorae"]
36
36
 
37
+ amphoraes = [dict(sorted(amphorae.items())) for amphorae in amphoraes]
38
+
37
39
  return amphoraes
@@ -21,6 +21,8 @@ class ExcelHypervisorExporter(HypervisorExporter):
21
21
  def export_hypervisors(self, hypervisors: list[Hypervisor]):
22
22
  df = pd.DataFrame([hypervisor.model_dump() for hypervisor in hypervisors])
23
23
 
24
+ df = util.expand_list_column(df, "aggregates")
25
+
24
26
  logger.info(f"Exporting hypervisors for {self.sheet_name}")
25
27
  try:
26
28
  util.export_data_excel(self.output_file, sheet_name=self.sheet_name, df=df)
@@ -59,16 +59,7 @@ class OpenStackHypervisorImporter(HypervisorImporter):
59
59
  def _get_hypervisor_info(
60
60
  self, hypervisor: OSHypervisor, aggregates: list[OSAggregate]
61
61
  ) -> Hypervisor:
62
- aggregate = self._get_aggregate(hypervisor=hypervisor)
63
-
64
- aggregate_id = None
65
- aggregate_name = None
66
- availability_zone = None
67
-
68
- if aggregate:
69
- aggregate_id = aggregate.id
70
- aggregate_name = aggregate.name
71
- availability_zone = aggregate.availability_zone
62
+ aggregate_list = self._get_aggregates(hypervisor=hypervisor)
72
63
 
73
64
  placement_proxy: PlacementProxy = self.connection.placement
74
65
 
@@ -97,18 +88,28 @@ class OpenStackHypervisorImporter(HypervisorImporter):
97
88
  memory_usage=usage_data["MEMORY_MB"],
98
89
  local_disk_usage=usage_data["DISK_GB"],
99
90
  vm_count=len(hypervisor.servers),
100
- aggregate_id=aggregate_id,
101
- aggregate_name=aggregate_name,
102
- availability_zone=availability_zone,
91
+ aggregates=aggregate_list,
103
92
  )
104
93
 
105
94
  return ret_hypervisor
106
95
 
107
- def _get_aggregate(self, hypervisor: OSHypervisor) -> OSAggregate:
108
- aggregates = list(self.connection.list_aggregates())
96
+ def _get_aggregates(self, hypervisor: OSHypervisor):
97
+ aggregates_ret = []
98
+
99
+ aggregates: OSAggregate = list(self.connection.list_aggregates())
109
100
 
110
101
  for aggregate in aggregates:
111
102
  if hypervisor.name in aggregate.hosts:
112
- return aggregate
113
-
114
- return None
103
+ aggregates_ret.append(
104
+ {
105
+ "id": aggregate.id,
106
+ "name": aggregate.name,
107
+ "availability_zone": aggregate.availability_zone,
108
+ }
109
+ )
110
+
111
+ aggregates_ret = [
112
+ dict(sorted(aggregate.items())) for aggregate in aggregates_ret
113
+ ]
114
+
115
+ return aggregates_ret
@@ -18,8 +18,6 @@ class Hypervisor(BaseModel):
18
18
  local_disk_usage: int
19
19
  local_disk_size: int
20
20
 
21
- availability_zone: Optional[str]
22
- aggregate_name: Optional[str]
23
- aggregate_id: Optional[int]
21
+ aggregates: Optional[list[dict]] # id, name, az
24
22
 
25
23
  vm_count: int
@@ -15,7 +15,7 @@ def get_endpoint(connection: Connection, service_type: str, interface: str) -> s
15
15
 
16
16
  ret = urllib.parse.urlunparse(
17
17
  parsed_endpoint._replace(netloc=f"{new_hostname}:{port}")._replace(
18
- scheme="https"
18
+ scheme="http"
19
19
  )
20
20
  )
21
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osi-dump
3
- Version: 0.1.3.1.3
3
+ Version: 0.1.3.1.5
4
4
  Summary: OpenStack information dump tool
5
5
  Author: TVKain
6
6
  License: Apache-2.0
@@ -3,7 +3,7 @@ osi_dump/__main__.py,sha256=fCVTLFipB-P0872_4j7iOJNNosOMBj3YdHr8TH_fhRY,71
3
3
  osi_dump/cli.py,sha256=vLijmcrWieCVK4cSLN2sK9ltWlercw9Zg6yBEvZtPkg,6379
4
4
  osi_dump/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  osi_dump/api/neutron.py,sha256=xRhNkEBDzOoUQHSWmkoI_Tdbcs8kvdS0UpPNkzxQv3g,1170
6
- osi_dump/api/octavia.py,sha256=-8EK16bA93yqvo4YPdP5gh1DjL-pn6CtbO9aBmVPhlc,1061
6
+ osi_dump/api/octavia.py,sha256=F03c9WaQpKbWOjCvFndZYStClfbhaGyYnIxtgqs1bQ0,1137
7
7
  osi_dump/api/placement.py,sha256=UvIGwAvowmCLobVARut8WnLVV-IdCDniyW9y16l2B_I,523
8
8
  osi_dump/batch_handler/__init__.py,sha256=wsiE42GCjbKgXBzpiahWEDF_-IXCKzr6PyrLn0oEKSc,288
9
9
  osi_dump/batch_handler/external_port_batch_handler.py,sha256=iGm0htGbLkpTX5RFPcrvXrVVn0eeTpavN3u4s58Z_pE,1783
@@ -28,7 +28,7 @@ osi_dump/exporter/floating_ip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
28
28
  osi_dump/exporter/floating_ip/excel_floating_ip_exporter.py,sha256=Bn1yZTvZ8dP3EhVHW-Pr4O9TC2Cz2RbJaz_vRE66xTQ,975
29
29
  osi_dump/exporter/floating_ip/floating_ip_exporter.py,sha256=5qh4xS6m1Gfu2N3WcfkEu6U38qtc6oLWAsnNhSwXTCo,169
30
30
  osi_dump/exporter/hypervisor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- osi_dump/exporter/hypervisor/excel_hypervisor_exporter.py,sha256=VhZoVjqCky5Sxvx0R9kxj-7O4tLTaPZKVqxyvqe1YLY,964
31
+ osi_dump/exporter/hypervisor/excel_hypervisor_exporter.py,sha256=N81LQR2G4m-w4U6MNNE7zuR-jMxSB1VA7OOuVceJQMA,1020
32
32
  osi_dump/exporter/hypervisor/hypervisor_exporter.py,sha256=HS3U-M-iv-ixNLfkGoaGdjdgHXXTBAjgtWQ_OhVY2xQ,167
33
33
  osi_dump/exporter/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  osi_dump/exporter/image/excel_image_exporter.py,sha256=S_9UScZKI4N8xe8oXjNfnV2Eh7_llg7tOPR7H0hGVnA,853
@@ -62,7 +62,7 @@ osi_dump/importer/floating_ip/floating_ip_importer.py,sha256=2_lCZYF-r2dgdL4Yzws
62
62
  osi_dump/importer/floating_ip/openstack_floating_ip_importer.py,sha256=xuALHyiyb4LdRgFN0hZvOx0pImKpGsLUtPWW_1q52gc,2286
63
63
  osi_dump/importer/hypervisor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  osi_dump/importer/hypervisor/hypervisor_importer.py,sha256=JuoJBltqFYhH-Ql9TLUPHX2YurS0JFV7Augrc6bDJ5Q,206
65
- osi_dump/importer/hypervisor/openstack_hypervisor_importer.py,sha256=SZr1m2P--FYPmTBQ9dXzLgxTfJgpmURWevV9aokjGyI,3785
65
+ osi_dump/importer/hypervisor/openstack_hypervisor_importer.py,sha256=Y2odXpQLjtvdfj9zMbQ-Yi-hqsqBg5sZ8SWjE3O7mdg,3826
66
66
  osi_dump/importer/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  osi_dump/importer/image/image_importer.py,sha256=6zwAMnS58S2HGwARwebqf4VE9IBQBv5Ot6nmcn9H4fY,181
68
68
  osi_dump/importer/image/openstack_image_importer.py,sha256=ffc13qnIGu07OXnIPaKiVxGdufep82RfQoKqLb1bwHc,2455
@@ -89,7 +89,7 @@ osi_dump/model/authentication_info.py,sha256=02kXxtILfjh8t45_-bPM8rtyRk2cQcJK6l2
89
89
  osi_dump/model/external_port.py,sha256=4FlyG8ZmQO7nNdavmRBhK8ZMsNogmhMqEBa03okvqXM,477
90
90
  osi_dump/model/flavor.py,sha256=bV1DAL0fMN-bZ0Is7Cd-LLuEdL1ihVPeGcLvbhOcB-I,301
91
91
  osi_dump/model/floating_ip.py,sha256=CRJufC5ZaxxcbGvdot7Af-sO8uyKbyQK9zHljfBnyFA,427
92
- osi_dump/model/hypervisor.py,sha256=asqY5EcjcFRgggUdiPMiEbffT7q7z8_5BwuZk7GBha0,468
92
+ osi_dump/model/hypervisor.py,sha256=QfoXpvR2GqGZrEP63wYFyC2251dxOEM0fo-tJR1pPPA,418
93
93
  osi_dump/model/image.py,sha256=JUr90XQgA6d3EyoZyV-Cyz4Y1GkEBIDhALsf-_eoR-Y,524
94
94
  osi_dump/model/instance.py,sha256=ixJUGMsNAsWIRSXXHZ2fHA9Wr1wPYZONyEhS75wfQp8,577
95
95
  osi_dump/model/load_balancer.py,sha256=T5RU6gm36ePYCh3KQ_OYO44FHMfxTcSNaiuKP5E_9CY,352
@@ -105,11 +105,11 @@ osi_dump/util/excel_autosize_column.py,sha256=zzQ6uXkQhHAqVn9fUAgNjoCH_HiNEC9Dcj
105
105
  osi_dump/util/excel_sort_sheet.py,sha256=o4jXtP1ZFYtAGzkAP5S8Tym4h-SEoFBAI3j24y-24UM,1047
106
106
  osi_dump/util/export_data_excel.py,sha256=VYSxDBZ7dgSbTj3n_8RRPqe183tILNh6wJW-UnFvJUU,882
107
107
  osi_dump/util/extract_hostname.py,sha256=IpdklGHevmtRu67xeSRE_5n2mvWGI1sDsnJwExo_AR0,111
108
- osi_dump/util/openstack_util.py,sha256=mPWLoVdSg4mukqtX87fN0Q9aDcRicJIqIsIOIIu1PnY,591
108
+ osi_dump/util/openstack_util.py,sha256=vIu3964dEQdwqAcJWzIpQSXlw0eIIZb7wHF_ttHVxt8,590
109
109
  osi_dump/util/panda_excel.py,sha256=GHHLguKLMm1sq4FHTPHABTjx7IqpOcGF_3OJT-cJORE,1011
110
110
  osi_dump/util/validate_dir_path.py,sha256=pL_OrY8JnNwk3vj6Zp6bsZtgHXhszSGRoqIt-1G5S90,507
111
- osi_dump-0.1.3.1.3.dist-info/METADATA,sha256=n5NNw6r7l5sheEfNyx7Jmw1f3Iue0QGb0yFaoDHzYRc,677
112
- osi_dump-0.1.3.1.3.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
113
- osi_dump-0.1.3.1.3.dist-info/entry_points.txt,sha256=ozm5sIBtXzLv6_FiUe26v1BgA3_xUReGLPhKQKZ56wQ,46
114
- osi_dump-0.1.3.1.3.dist-info/top_level.txt,sha256=OtAAwmJfcoPvlw_Cemo_H1aXIGV_7w0O2941KQt6faQ,9
115
- osi_dump-0.1.3.1.3.dist-info/RECORD,,
111
+ osi_dump-0.1.3.1.5.dist-info/METADATA,sha256=BFKCPciNBOJXee6MzbUz5o2EuknPleTHneRyT2wvnp8,677
112
+ osi_dump-0.1.3.1.5.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
113
+ osi_dump-0.1.3.1.5.dist-info/entry_points.txt,sha256=ozm5sIBtXzLv6_FiUe26v1BgA3_xUReGLPhKQKZ56wQ,46
114
+ osi_dump-0.1.3.1.5.dist-info/top_level.txt,sha256=OtAAwmJfcoPvlw_Cemo_H1aXIGV_7w0O2941KQt6faQ,9
115
+ osi_dump-0.1.3.1.5.dist-info/RECORD,,