blivet.dbus package¶
Submodules¶
blivet.dbus.action module¶
- class blivet.dbus.action.DBusAction(action, manager)¶
Bases:
DBusObject
Constructor. Either conn or bus_name is required; object_path is also required.
- Parameters:
- conndbus.connection.Connection or None
The connection on which to export this object.
If None, use the Bus associated with the given
bus_name
. If there is nobus_name
either, the object is not initially available on any Connection.For backwards compatibility, if an instance of dbus.service.BusName is passed as the first parameter, this is equivalent to passing its associated Bus as
conn
, and passing the BusName itself asbus_name
.- object_pathstr or None
A D-Bus object path at which to make this Object available immediately. If this is not None, a conn or bus_name must also be provided.
- bus_namedbus.service.BusName or None
Represents a well-known name claimed by this process. A reference to the BusName object will be held by this Object, preventing the name from being released during this Object’s lifetime (unless it’s released manually).
- property id¶
The unique id of this instance.
- property interface¶
The interface implemented by this class.
- property object_path¶
The dbus object path for this instance.
- property properties¶
dict of property key/value pairs to export via dbus.
blivet.dbus.blivet module¶
- class blivet.dbus.blivet.DBusBlivet(manager)¶
Bases:
DBusObject
This class provides the main entry point to the Blivet1 service.
It provides methods for controlling the blivet service and querying its state.
Constructor. Either conn or bus_name is required; object_path is also required.
- Parameters:
- conndbus.connection.Connection or None
The connection on which to export this object.
If None, use the Bus associated with the given
bus_name
. If there is nobus_name
either, the object is not initially available on any Connection.For backwards compatibility, if an instance of dbus.service.BusName is passed as the first parameter, this is equivalent to passing its associated Bus as
conn
, and passing the BusName itself asbus_name
.- object_pathstr or None
A D-Bus object path at which to make this Object available immediately. If this is not None, a conn or bus_name must also be provided.
- bus_namedbus.service.BusName or None
Represents a well-known name claimed by this process. A reference to the BusName object will be held by this Object, preventing the name from being released during this Object’s lifetime (unless it’s released manually).
- Commit()¶
Commit pending changes to disk.
- Exit()¶
Stop the blivet service.
- Factory(kwargs)¶
- InitializeDisk(object_path)¶
Clear a disk and create a disklabel on it.
- ListDevices()¶
Return a list of strings describing the devices in this system.
- RemoveDevice(object_path)¶
Remove a device and all devices built on it.
- Reset()¶
Reset the Blivet instance and populate the device tree.
- ResolveDevice(spec)¶
Return a string describing the device the given specifier resolves to.
- property id¶
The unique id of this instance.
- property interface¶
The interface implemented by this class.
- property object_path¶
The dbus object path for this instance.
- property properties¶
dict of property key/value pairs to export via dbus.
- transient = False¶
- blivet.dbus.blivet.sorted_object_paths_from_list(obj_list)¶
blivet.dbus.constants module¶
blivet.dbus.device module¶
- class blivet.dbus.device.DBusDevice(device, manager)¶
Bases:
DBusObject
Constructor. Either conn or bus_name is required; object_path is also required.
- Parameters:
- conndbus.connection.Connection or None
The connection on which to export this object.
If None, use the Bus associated with the given
bus_name
. If there is nobus_name
either, the object is not initially available on any Connection.For backwards compatibility, if an instance of dbus.service.BusName is passed as the first parameter, this is equivalent to passing its associated Bus as
conn
, and passing the BusName itself asbus_name
.- object_pathstr or None
A D-Bus object path at which to make this Object available immediately. If this is not None, a conn or bus_name must also be provided.
- bus_namedbus.service.BusName or None
Represents a well-known name claimed by this process. A reference to the BusName object will be held by this Object, preventing the name from being released during this Object’s lifetime (unless it’s released manually).
- Setup()¶
Activate this device.
- Teardown()¶
Deactivate this device.
- property id¶
The unique id of this instance.
- property interface¶
The interface implemented by this class.
- property object_path¶
The dbus object path for this instance.
- property properties¶
dict of property key/value pairs to export via dbus.
blivet.dbus.format module¶
- class blivet.dbus.format.DBusFormat(fmt, manager)¶
Bases:
DBusObject
Constructor. Either conn or bus_name is required; object_path is also required.
- Parameters:
- conndbus.connection.Connection or None
The connection on which to export this object.
If None, use the Bus associated with the given
bus_name
. If there is nobus_name
either, the object is not initially available on any Connection.For backwards compatibility, if an instance of dbus.service.BusName is passed as the first parameter, this is equivalent to passing its associated Bus as
conn
, and passing the BusName itself asbus_name
.- object_pathstr or None
A D-Bus object path at which to make this Object available immediately. If this is not None, a conn or bus_name must also be provided.
- bus_namedbus.service.BusName or None
Represents a well-known name claimed by this process. A reference to the BusName object will be held by this Object, preventing the name from being released during this Object’s lifetime (unless it’s released manually).
- Setup(kwargs)¶
- Teardown()¶
- property id¶
The unique id of this instance.
- property interface¶
The interface implemented by this class.
- property object_path¶
The dbus object path for this instance.
- property properties¶
dict of property key/value pairs to export via dbus.
blivet.dbus.manager module¶
- class blivet.dbus.manager.ObjectManager¶
Bases:
Object
Class to implement org.freedesktop.DBus.ObjectManager interface.
Blivet’s ObjectManager interface will manage subtrees for objects that variously (and with mutual-exclusivity) implement blivet’s Device, Format, Action interfaces.
Constructor. Either conn or bus_name is required; object_path is also required.
- Parameters:
- conndbus.connection.Connection or None
The connection on which to export this object.
If None, use the Bus associated with the given
bus_name
. If there is nobus_name
either, the object is not initially available on any Connection.For backwards compatibility, if an instance of dbus.service.BusName is passed as the first parameter, this is equivalent to passing its associated Bus as
conn
, and passing the BusName itself asbus_name
.- object_pathstr or None
A D-Bus object path at which to make this Object available immediately. If this is not None, a conn or bus_name must also be provided.
- bus_namedbus.service.BusName or None
Represents a well-known name claimed by this process. A reference to the BusName object will be held by this Object, preventing the name from being released during this Object’s lifetime (unless it’s released manually).
- GetManagedObjects()¶
- InterfacesAdded(*args, **keywords)¶
- InterfacesRemoved(*args, **keywords)¶
- add_object(obj)¶
- get_object_by_id(obj_id)¶
- get_object_by_path(obj_path)¶
- property objects¶
- remove_object(obj)¶
blivet.dbus.object module¶
- class blivet.dbus.object.DBusObject(manager)¶
Bases:
Object
Base class for dbus objects.
Constructor. Either conn or bus_name is required; object_path is also required.
- Parameters:
- conndbus.connection.Connection or None
The connection on which to export this object.
If None, use the Bus associated with the given
bus_name
. If there is nobus_name
either, the object is not initially available on any Connection.For backwards compatibility, if an instance of dbus.service.BusName is passed as the first parameter, this is equivalent to passing its associated Bus as
conn
, and passing the BusName itself asbus_name
.- object_pathstr or None
A D-Bus object path at which to make this Object available immediately. If this is not None, a conn or bus_name must also be provided.
- bus_namedbus.service.BusName or None
Represents a well-known name claimed by this process. A reference to the BusName object will be held by this Object, preventing the name from being released during this Object’s lifetime (unless it’s released manually).
- Get(interface_name, property_name)¶
- GetAll(interface_name)¶
- PropertiesChanged(*args, **keywords)¶
- Set(interface_name, property_name, new_value)¶
- property id¶
The unique id of this instance.
- property interface¶
The interface implemented by this class.
- property object_path¶
The dbus object path for this instance.
- property present¶
Is this object present in blivet’s current view?
- property properties¶
dict of property key/value pairs to export via dbus.
- remove_from_connection(connection=None, path=None)¶
Make this object inaccessible via the given D-Bus connection and object path. If no connection or path is specified, the object ceases to be accessible via any connection or path.
- Parameters:
- connectiondbus.connection.Connection or None
Only remove the object from this Connection. If None, remove from all Connections on which it’s exported.
- pathdbus.ObjectPath or other str, or None
Only remove the object from this object path. If None, remove from all object paths.
- Raises LookupError:
if the object was not exported on the requested connection or path, or (if both are None) was not exported at all.
- Since:
0.81.1
- transient = True¶