statuf on load fixed?

This commit is contained in:
Holger Sielaff
2025-09-04 10:15:41 +02:00
parent c5e7e3739f
commit d10938d2d2
3 changed files with 19 additions and 10 deletions

View File

@@ -97,6 +97,9 @@ class ProxmoxAbstractModel(BaseModel, TaskAwareModelMixin):
return self.write(**params)
else:
return params
@property
def vmstatus(self):
raise NotImplemented('vmstatus not implemented')
class Lxc(ProxmoxAbstractModel):
@@ -123,6 +126,13 @@ class Lxc(ProxmoxAbstractModel):
'rootfs': ('size', 'disksize', lambda x: int(no_int_re.sub('', x) or 0)),
}
@property
def synced_status(self):
with Proxmox() as pm:
if statusresponse := pm.lxc_get(f'{self.vmid}/status/current'):
self.write(status=statusresponse['status'])
return self.status
@property
def proxmox_console_url(self):
return (