rpyc-pve-cloud 0.0.31__py3-none-any.whl → 0.0.32__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.
pve_cloud_rpc/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.0.31"
1
+ __version__ = "0.0.32"
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # -*- coding: utf-8 -*-
5
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
6
3
  # NO CHECKED-IN PROTOBUF GENCODE
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
5
2
  """Client and server classes corresponding to protobuf-defined services."""
6
3
  import grpc
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # -*- coding: utf-8 -*-
5
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
6
3
  # NO CHECKED-IN PROTOBUF GENCODE
@@ -27,7 +24,7 @@ _sym_db = _symbol_database.Default()
27
24
 
28
25
 
29
26
 
30
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0chealth.proto\x12\x06protos\"%\n\x12HealthCheckRequest\x12\x0f\n\x07service\x18\x01 \x01(\t\"\xa1\x01\n\x13HealthCheckResponse\x12\x39\n\x06status\x18\x01 \x01(\x0e\x32).protos.HealthCheckResponse.ServingStatus\"O\n\rServingStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVING\x10\x01\x12\x0f\n\x0bNOT_SERVING\x10\x02\x12\x13\n\x0fSERVICE_UNKNOWN\x10\x03\x32J\n\x06Health\x12@\n\x05\x43heck\x12\x1a.protos.HealthCheckRequest\x1a\x1b.protos.HealthCheckResponseBQZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protosb\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0chealth.proto\x12\x06protos\"(\n\x12HealthCheckRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"\x94\x01\n\x13HealthCheckResponse\x12\x39\n\x06status\x18\x01 \x01(\x0e\x32).protos.HealthCheckResponse.ServingStatus\x12\x15\n\rerror_message\x18\x02 \x01(\t\"+\n\rServingStatus\x12\x0b\n\x07SERVING\x10\x00\x12\r\n\tMISSMATCH\x10\x01\x32J\n\x06Health\x12@\n\x05\x43heck\x12\x1a.protos.HealthCheckRequest\x1a\x1b.protos.HealthCheckResponseBQZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protosb\x06proto3')
31
28
 
32
29
  _globals = globals()
33
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -36,11 +33,11 @@ if not _descriptor._USE_C_DESCRIPTORS:
36
33
  _globals['DESCRIPTOR']._loaded_options = None
37
34
  _globals['DESCRIPTOR']._serialized_options = b'ZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protos'
38
35
  _globals['_HEALTHCHECKREQUEST']._serialized_start=24
39
- _globals['_HEALTHCHECKREQUEST']._serialized_end=61
40
- _globals['_HEALTHCHECKRESPONSE']._serialized_start=64
41
- _globals['_HEALTHCHECKRESPONSE']._serialized_end=225
42
- _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_start=146
43
- _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_end=225
44
- _globals['_HEALTH']._serialized_start=227
45
- _globals['_HEALTH']._serialized_end=301
36
+ _globals['_HEALTHCHECKREQUEST']._serialized_end=64
37
+ _globals['_HEALTHCHECKRESPONSE']._serialized_start=67
38
+ _globals['_HEALTHCHECKRESPONSE']._serialized_end=215
39
+ _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_start=172
40
+ _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_end=215
41
+ _globals['_HEALTH']._serialized_start=217
42
+ _globals['_HEALTH']._serialized_end=291
46
43
  # @@protoc_insertion_point(module_scope)
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
5
2
  """Client and server classes corresponding to protobuf-defined services."""
6
3
  import grpc
pve_cloud_rpc/server.py CHANGED
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  import asyncio, asyncssh
5
2
  import grpc
6
3
  import pve_cloud_rpc.protos.cloud_pb2 as cloud_pb2
@@ -15,17 +12,16 @@ import sys
15
12
 
16
13
 
17
14
  class HealthServicer(health_pb2_grpc.HealthServicer):
18
- def __init__(self):
19
- self._statuses = {}
20
15
 
16
+ # this also performs the py-pve-cloud version check to not run against incompatible
17
+ # installed proxmox cloud versions
21
18
  async def Check(self, request, context):
22
- service_name = request.service or ""
23
- status = self._statuses.get(service_name, health_pb2.HealthCheckResponse.UNKNOWN)
24
- print(f"Health Check request for service '{service_name}', returning {status}")
25
- return health_pb2.HealthCheckResponse(status=status)
26
-
27
- def set_status(self, service_name: str, status: health_pb2.HealthCheckResponse.ServingStatus):
28
- self._statuses[service_name] = status
19
+ target_pve = request.target_pve
20
+ try:
21
+ get_online_pve_host(target_pve, skip_py_cloud_check=False) # actually perform the check
22
+ return health_pb2.HealthCheckResponse(status=health_pb2.HealthCheckResponse.SERVING)
23
+ except RuntimeError as e:
24
+ return health_pb2.HealthCheckResponse(status=health_pb2.HealthCheckResponse.MISSMATCH, error_message=f"py-pve-cloud version check failed with: {e}") # go provider process will kill
29
25
 
30
26
 
31
27
  class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
@@ -139,21 +135,12 @@ async def serve():
139
135
 
140
136
  health_servicer = HealthServicer()
141
137
  health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
142
-
143
- # if is_port_bound(50052): # google quirks nice
144
- # raise RuntimeError("PCRPC Already running / unclean shutdown!")
145
138
 
146
139
  socket_file = f"/tmp/pc-rpc-{sys.argv[1]}.sock"
147
140
 
148
- # listen_addr = "[::]:50052"
149
141
  server.add_insecure_port(f"unix://{socket_file}")
150
142
  await server.start()
151
143
 
152
- health_servicer.set_status(
153
- "", # empty = overall server health
154
- health_pb2.HealthCheckResponse.SERVING
155
- )
156
- # print(f"gRPC AsyncIO server running on {listen_addr}")
157
144
  print(f"gRPC AsyncIO server running on {socket_file}")
158
145
  try:
159
146
  await server.wait_for_termination()
@@ -167,6 +154,5 @@ async def serve():
167
154
  os.remove(socket_file)
168
155
 
169
156
 
170
-
171
157
  def main():
172
158
  asyncio.run(serve())
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rpyc-pve-cloud
3
- Version: 0.0.31
3
+ Version: 0.0.32
4
4
  Author-email: Tobias Huebner <tobias.huebner@vmzberlin.com>
5
5
  License-Expression: GPL-3.0-or-later
6
6
  License-File: LICENSE.md
7
- Requires-Dist: py-pve-cloud<0.14.0,>=0.13.12
7
+ Requires-Dist: py-pve-cloud<0.14.0,>=0.13.13
8
8
  Requires-Dist: grpcio==1.76.0
9
9
  Requires-Dist: asyncssh==2.21.0
10
10
  Requires-Dist: protobuf==6.33.2
@@ -0,0 +1,12 @@
1
+ pve_cloud_rpc/_version.py,sha256=WKDnjJM7gYpD9fIwhK2qAZICJAT2ndquQ6VcOar074Y,23
2
+ pve_cloud_rpc/server.py,sha256=0UMKGkT-HNEnx5rULEl5vRA0HtKMeLv3k7Apb7iUExQ,6209
3
+ pve_cloud_rpc/protos/cloud_pb2.py,sha256=8w_hu6psK9ooFbqPCGeTY398XbntH61I3b3k4jvQTcg,6133
4
+ pve_cloud_rpc/protos/cloud_pb2_grpc.py,sha256=FOC_MXEZkXe32dzxQua9zHBLWLjso1X-xqj0xTexfFg,15535
5
+ pve_cloud_rpc/protos/health_pb2.py,sha256=532OgHM0bPu6uyJNyYETlRJp9BzcCZ53fnrRtEu7bnA,2188
6
+ pve_cloud_rpc/protos/health_pb2_grpc.py,sha256=XXT8lsH8YgKLqn07YfigSQ6TNW6s-P4V6S-X69fLfh0,3368
7
+ rpyc_pve_cloud-0.0.32.dist-info/licenses/LICENSE.md,sha256=ADUqsZhl4juwq34PRTMiBqumpm11s_PMli_dZQjWPqQ,34260
8
+ rpyc_pve_cloud-0.0.32.dist-info/METADATA,sha256=F7At8iKzwzBVN0hfAKIIZx5s4hngXynBp_sXqhXPrGY,342
9
+ rpyc_pve_cloud-0.0.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ rpyc_pve_cloud-0.0.32.dist-info/entry_points.txt,sha256=h4ytTryc_8IlySP_ICyy6srHzF71qrQ0noUhqI-3aGw,52
11
+ rpyc_pve_cloud-0.0.32.dist-info/top_level.txt,sha256=CTGM4RRp33khtroUiv-RiYXI4h6W6AaQQGIvsbwAetM,14
12
+ rpyc_pve_cloud-0.0.32.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- pve_cloud_rpc/_version.py,sha256=YRrMDApG1V6fNZdI4BA631DmsqtamSXgI1yu0tnt4h0,23
2
- pve_cloud_rpc/server.py,sha256=oZWZYAwQl8eCd4qHH0u7k11lVkPPdtcZrtjdArgh3vg,6507
3
- pve_cloud_rpc/protos/cloud_pb2.py,sha256=O1DXdbm0KSG7Nose6XWfCz9VU2ujW0uK2CTwgFuuQA0,6201
4
- pve_cloud_rpc/protos/cloud_pb2_grpc.py,sha256=mDHCc8Sc-dGhISEUchfmJI74rISbdysNUzkDhOyTQ8I,15603
5
- pve_cloud_rpc/protos/health_pb2.py,sha256=t_Xinf3sAzzY-NL9g1LKFfnw2v7XhsEJ8mrKRhQLcEw,2286
6
- pve_cloud_rpc/protos/health_pb2_grpc.py,sha256=h4NndEaW_Em92bktRkL1VqT_WIVqfifQg_SVbAOYjfc,3436
7
- rpyc_pve_cloud-0.0.31.dist-info/licenses/LICENSE.md,sha256=ADUqsZhl4juwq34PRTMiBqumpm11s_PMli_dZQjWPqQ,34260
8
- rpyc_pve_cloud-0.0.31.dist-info/METADATA,sha256=bimPX54aYJQG_EvRLIaYDKZ2GIhPz5qvGPrF0y1TzaA,342
9
- rpyc_pve_cloud-0.0.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- rpyc_pve_cloud-0.0.31.dist-info/entry_points.txt,sha256=h4ytTryc_8IlySP_ICyy6srHzF71qrQ0noUhqI-3aGw,52
11
- rpyc_pve_cloud-0.0.31.dist-info/top_level.txt,sha256=CTGM4RRp33khtroUiv-RiYXI4h6W6AaQQGIvsbwAetM,14
12
- rpyc_pve_cloud-0.0.31.dist-info/RECORD,,