summaryrefslogtreecommitdiff
path: root/modules/nspawn/facts.d
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-12 02:26:25 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-12 02:26:25 +0100
commitdd28dcf3d620a4ac7d0a1532b812213cf094cd3c (patch)
treea3fa8c8ef446de2bcc2f317bceb4bca868f7e0f0 /modules/nspawn/facts.d
parentMove webdav into profiles. (diff)
downloadwebdav_server-dd28dcf3d620a4ac7d0a1532b812213cf094cd3c.tar.gz
webdav_server-dd28dcf3d620a4ac7d0a1532b812213cf094cd3c.tar.xz
Revert "Move webdav into profiles."
It actually reverts the non-need for the nginx module webdav_ext. Since Omnifocus requires PROPFIND. This reverts commit edf6ffe8b399679ba28cc5e558a6838919dd1ee8.
Diffstat (limited to 'modules/nspawn/facts.d')
-rwxr-xr-xmodules/nspawn/facts.d/main.py64
1 files changed, 0 insertions, 64 deletions
diff --git a/modules/nspawn/facts.d/main.py b/modules/nspawn/facts.d/main.py
deleted file mode 100755
index 0db37f3..0000000
--- a/modules/nspawn/facts.d/main.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python3
-
-import dbus
-import yaml
-
-bus = dbus.SystemBus()
-bus_name = 'org.freedesktop.machine1' # dest
-object_path = '/org/freedesktop/machine1'
-machined_proxy = bus.get_object(bus_name=bus_name, object_path=object_path)
-iface = dbus.Interface(machined_proxy, dbus_interface='org.freedesktop.machine1.Manager')
-
-
-machines = iface.ListMachines()
-machine_names = []
-machines_info = {}
-for (machine_name, *_) in machines:
- machine = iface.GetMachine(machine_name)
- pp = bus.get_object(bus_name='org.freedesktop.machine1', object_path=machine)
- ii = dbus.Interface(pp, dbus_interface='org.freedesktop.DBus.Properties')
- out_dict = {}
- for key, value in ii.GetAll('org.freedesktop.machine1.Machine').items():
- # see help(dbus.types)
- match type(value):
- case dbus.ByteArray:
- raise NotImplementedError('Byte array')
- case dbus.Double:
- v = float(value)
- case dbus.Boolean:
- v = bool(value)
- case dbus.Byte | dbus.Int16 | dbus.Int32 | dbus.Int64 | dbus.UInt16 | dbus.UInt32 | dbus.UInt64:
- v = int(value)
- case dbus.ObjectPath | dbus.Signature:
- # string likes
- v = str(value)
- case dbus.Dictionary:
- # dict like
- raise NotImplementedError('Dictionary')
- case dbus.Array:
- match value.signature:
- case dbus.Signature('y'):
- v = bytes(int(x) for x in value)
- case dbus.Signature('i'):
- v = [int(x) for x in value]
- case _:
- print(repr(value))
- print(repr(value.signature))
- raise NotImplementedError('Array')
- # case dbus.UnixFd:
- # raise NotImplementedError()
- case dbus.String:
- v = str(value)
- case dbus.Struct:
- # tuple like
- raise NotImplementedError('Struct')
- out_dict[str(key)] = v
- machine_names.append(str(machine_name))
- machines_info[str(machine_name)] = out_dict
-
-out = {
- 'machined-machines': machine_names,
- 'machined-info': machines_info,
-}
-
-print(yaml.dump(out))