py-pve-cloud 3.2.3__tar.gz → 3.2.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.2.3/src/py_pve_cloud.egg-info → py_pve_cloud-3.2.5}/PKG-INFO +1 -1
- py_pve_cloud-3.2.5/src/pve_cloud/_version.py +1 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/cli/pvcli.py +28 -4
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5/src/py_pve_cloud.egg-info}/PKG-INFO +1 -1
- py_pve_cloud-3.2.3/src/pve_cloud/_version.py +0 -1
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/LICENSE.md +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/README.md +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/pyproject.toml +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/setup.cfg +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/cli/pvclu.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/cli/pxrpc.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/lib/inventory.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/lib/ssh.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/alchemy.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/alembic.ini +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/env.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/04398db10434_external_cp_extra_sans.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/0ad803c51325_machine_type_refactor.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/24a548bfce3e_len_rules_enforcements.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/27724e407e2b_proxy_fqdn.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/3c95509a5de9_fix.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/7496c3f3b2e8_fix_secrets_constraint.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/7868bcd05006_migrate_old.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/7dea8c4ee39f_init.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/944a8fd5d5bc_ext_ctrl_plns.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/9de11ef8ba39_vm_vars_and_cloud_secrets.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/d9b711555be8_ext_control_plane.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/e60b9cc63413_ingress_generic.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/e6ae1e138c1f_change_scope_cloud.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/ee4924ac4f60_secrets_plural_type.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/fdcb5aa33b76_slop_firewall_seperation.py +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/py_pve_cloud.egg-info/SOURCES.txt +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/py_pve_cloud.egg-info/dependency_links.txt +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/py_pve_cloud.egg-info/entry_points.txt +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/py_pve_cloud.egg-info/requires.txt +0 -0
- {py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/py_pve_cloud.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.2.5"
|
|
@@ -10,9 +10,8 @@ from pve_cloud_schemas.validate import (validate_cloud_dyn_inv,
|
|
|
10
10
|
from pve_cloud.cli.pvclu import (get_ssh_master_kubeconfig,
|
|
11
11
|
get_ssh_remote_master_kubeconfig)
|
|
12
12
|
from pve_cloud.cli.pxrpc import PxServiceEnum, launch_pxrpc
|
|
13
|
-
from pve_cloud.lib.inventory import (get_cloud_domain,
|
|
14
|
-
|
|
15
|
-
get_target_cluster)
|
|
13
|
+
from pve_cloud.lib.inventory import (get_cloud_domain, get_online_pve_host,
|
|
14
|
+
get_pve_inventory, get_target_cluster)
|
|
16
15
|
from pve_cloud.lib.ssh import connect_host
|
|
17
16
|
|
|
18
17
|
inv_path = os.path.expanduser("~/.pve-cloud-dyn-inv.yaml")
|
|
@@ -118,6 +117,14 @@ def connect_remote_cluster(args):
|
|
|
118
117
|
) as (pxrpc, pve_host):
|
|
119
118
|
|
|
120
119
|
def read_cluster_vars():
|
|
120
|
+
# check if the variables exist at all
|
|
121
|
+
result = pve_host.run("test -f /etc/pve/cloud/cluster_vars.yaml", warn=True)
|
|
122
|
+
|
|
123
|
+
# return none if they dont exist
|
|
124
|
+
if result.failed:
|
|
125
|
+
print("Cluster vars not present, initializing new cluster...")
|
|
126
|
+
return None
|
|
127
|
+
|
|
121
128
|
result = pve_host.run("cat /etc/pve/cloud/cluster_vars.yaml")
|
|
122
129
|
cluster_vars = yaml.safe_load(result.stdout.strip())
|
|
123
130
|
validate_cluster_vars(cluster_vars)
|
|
@@ -138,7 +145,24 @@ def connect_cluster(args):
|
|
|
138
145
|
proxmox = ProxmoxAPI(args.pve_host, user="root", backend="ssh_paramiko")
|
|
139
146
|
|
|
140
147
|
def read_cluster_vars():
|
|
141
|
-
|
|
148
|
+
with connect_host(args.pve_host) as ssh:
|
|
149
|
+
# first check if the variables already exist
|
|
150
|
+
_, stdout, _ = ssh.exec_command(
|
|
151
|
+
"test -f /etc/pve/cloud/cluster_vars.yaml && echo 'exists'"
|
|
152
|
+
)
|
|
153
|
+
exists = stdout.read().decode("utf-8").strip() == "exists"
|
|
154
|
+
|
|
155
|
+
if not exists:
|
|
156
|
+
print("Cluster vars not present, initializing new cluster...")
|
|
157
|
+
return None # return none for dyn inv handler func
|
|
158
|
+
|
|
159
|
+
# fetching from pmxcfs needs cat, ftp does not work
|
|
160
|
+
_, stdout, _ = ssh.exec_command("cat /etc/pve/cloud/cluster_vars.yaml")
|
|
161
|
+
|
|
162
|
+
cluster_vars = yaml.safe_load(stdout.read().decode("utf-8"))
|
|
163
|
+
validate_cluster_vars(cluster_vars)
|
|
164
|
+
|
|
165
|
+
return cluster_vars
|
|
142
166
|
|
|
143
167
|
def get_cluster_name():
|
|
144
168
|
cluster_name = None
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "3.2.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
|
{py_pve_cloud-3.2.3 → py_pve_cloud-3.2.5}/src/pve_cloud/orm/migrations/versions/3c95509a5de9_fix.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{py_pve_cloud-3.2.3 → py_pve_cloud-3.2.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
|