py-pve-cloud 3.4.3__tar.gz → 3.4.5__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.
- {py_pve_cloud-3.4.3/src/py_pve_cloud.egg-info → py_pve_cloud-3.4.5}/PKG-INFO +1 -1
- py_pve_cloud-3.4.5/src/pve_cloud/_version.py +1 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/cli/pxrpc.py +22 -13
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5/src/py_pve_cloud.egg-info}/PKG-INFO +1 -1
- py_pve_cloud-3.4.3/src/pve_cloud/_version.py +0 -1
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/LICENSE.md +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/README.md +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/pyproject.toml +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/setup.cfg +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/cli/pvcli.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/cli/pvclu.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/lib/backup_rpc.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/lib/inventory.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/lib/ssh.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/alchemy.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/alembic.ini +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/env.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/04398db10434_external_cp_extra_sans.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/0ad803c51325_machine_type_refactor.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/24a548bfce3e_len_rules_enforcements.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/27724e407e2b_proxy_fqdn.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/3c95509a5de9_fix.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/7496c3f3b2e8_fix_secrets_constraint.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/7868bcd05006_migrate_old.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/7dea8c4ee39f_init.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/944a8fd5d5bc_ext_ctrl_plns.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/9de11ef8ba39_vm_vars_and_cloud_secrets.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/d9b711555be8_ext_control_plane.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/e60b9cc63413_ingress_generic.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/e6ae1e138c1f_change_scope_cloud.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/ee4924ac4f60_secrets_plural_type.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/fdcb5aa33b76_slop_firewall_seperation.py +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/py_pve_cloud.egg-info/SOURCES.txt +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/py_pve_cloud.egg-info/dependency_links.txt +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/py_pve_cloud.egg-info/entry_points.txt +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/py_pve_cloud.egg-info/requires.txt +0 -0
- {py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/py_pve_cloud.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.4.5"
|
|
@@ -96,8 +96,9 @@ class RemoteProxmoxApi(rpyc.Service):
|
|
|
96
96
|
@rpyc.service
|
|
97
97
|
class PxrpcService(rpyc.Service):
|
|
98
98
|
|
|
99
|
-
# functions for constructor
|
|
100
|
-
|
|
99
|
+
# functions for constructor, only for when the service is launched
|
|
100
|
+
# as a real remote service on a proxmox host!
|
|
101
|
+
def _get_cluster_vars(self):
|
|
101
102
|
result_vars = subprocess.run(
|
|
102
103
|
["cat", "/etc/pve/cloud/cluster_vars.yaml"],
|
|
103
104
|
capture_output=True,
|
|
@@ -109,7 +110,7 @@ class PxrpcService(rpyc.Service):
|
|
|
109
110
|
|
|
110
111
|
return cluster_vars
|
|
111
112
|
|
|
112
|
-
def
|
|
113
|
+
def _get_pg_conn_str(self, cluster_vars):
|
|
113
114
|
# needs to be cat because of proxmox fs
|
|
114
115
|
result_pass = subprocess.run(
|
|
115
116
|
["cat", "/etc/pve/cloud/secrets/patroni.pass"],
|
|
@@ -121,7 +122,7 @@ class PxrpcService(rpyc.Service):
|
|
|
121
122
|
|
|
122
123
|
return f"postgresql+psycopg2://postgres:{patroni_pass}@{cluster_vars['pve_haproxy_floating_ip_internal']}:5000/pve_cloud?sslmode=disable"
|
|
123
124
|
|
|
124
|
-
def
|
|
125
|
+
def _get_internal_bind_key(self):
|
|
125
126
|
result_key = subprocess.run(
|
|
126
127
|
["cat", "/etc/pve/cloud/secrets/internal.key"],
|
|
127
128
|
capture_output=True,
|
|
@@ -131,37 +132,45 @@ class PxrpcService(rpyc.Service):
|
|
|
131
132
|
|
|
132
133
|
return re.search(r'secret\s+"([^"]+)";', result_key.stdout).group(1)
|
|
133
134
|
|
|
135
|
+
# rpyc doesnt have a clean shutdown methodology
|
|
136
|
+
# this is the cleanest i found without triggerin eof on the clients side
|
|
137
|
+
@rpyc.exposed
|
|
138
|
+
def shutdown(self):
|
|
139
|
+
os.kill(MASTER_PID, signal.SIGTERM) # this triggers the shutdown handler
|
|
140
|
+
|
|
134
141
|
def __init__(self, cluster_vars=None, patroni_cstr=None, internal_bind_key=None):
|
|
135
142
|
super().__init__()
|
|
136
143
|
|
|
137
144
|
if cluster_vars:
|
|
138
145
|
self.cluster_vars = cluster_vars
|
|
139
146
|
else:
|
|
140
|
-
self.cluster_vars = self.
|
|
147
|
+
self.cluster_vars = self._get_cluster_vars()
|
|
141
148
|
|
|
142
149
|
if internal_bind_key:
|
|
143
150
|
self.internal_bind_key = internal_bind_key
|
|
144
151
|
else:
|
|
145
|
-
self.internal_bind_key = self.
|
|
152
|
+
self.internal_bind_key = self._get_internal_bind_key()
|
|
146
153
|
|
|
147
154
|
if patroni_cstr:
|
|
148
155
|
self.patroni_cstr = patroni_cstr
|
|
149
156
|
else:
|
|
150
|
-
self.patroni_cstr = self.
|
|
157
|
+
self.patroni_cstr = self._get_pg_conn_str(
|
|
151
158
|
self.cluster_vars
|
|
152
159
|
) # we need postgres for almost anything
|
|
153
160
|
|
|
161
|
+
# return initted cluster vars
|
|
162
|
+
@rpyc.exposed
|
|
163
|
+
def get_cluster_vars(self):
|
|
164
|
+
return self.cluster_vars
|
|
165
|
+
|
|
166
|
+
# after initialization these functions can be called from anywhere
|
|
167
|
+
# either via the local wrapper on cloud connecitons that are not tunneled
|
|
168
|
+
# via a jump host, and also for true remote launches.
|
|
154
169
|
@rpyc.exposed
|
|
155
170
|
def e2e_return(self):
|
|
156
171
|
print(f"e2e return on pid {os.getpid()}")
|
|
157
172
|
return self.patroni_cstr
|
|
158
173
|
|
|
159
|
-
# rpyc doesnt have a clean shutdown methodology
|
|
160
|
-
# this is the cleanest i found without triggerin eof on the clients side
|
|
161
|
-
@rpyc.exposed
|
|
162
|
-
def shutdown(self):
|
|
163
|
-
os.kill(MASTER_PID, signal.SIGTERM) # this triggers the shutdown handler
|
|
164
|
-
|
|
165
174
|
@rpyc.exposed
|
|
166
175
|
def resolve_k8s_master(self, nameservers, a_rs_hostname):
|
|
167
176
|
resolver = dns.resolver.Resolver()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "3.4.3"
|
|
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
|
{py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/3c95509a5de9_fix.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{py_pve_cloud-3.4.3 → py_pve_cloud-3.4.5}/src/pve_cloud/orm/migrations/versions/7dea8c4ee39f_init.py
RENAMED
|
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
|