mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-02 01:51:53 +01:00
target: Customize as_root parameter of *write_value()
Not all command executions (or write operations in this specific case) requires being root. So, allow write_value() and dependent revertable_write_value() to support non-root executions by introducing 'as_root' optional parameter whose default is True to preserve current behavior of the aforementioned methods. Meanwhile, update the copyright year of the touched file, too. Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
@@ -386,7 +386,7 @@ Target
|
||||
|
||||
Equivalent to ``Target.read_value(path, kind=devlib.utils.types.boolean)``
|
||||
|
||||
.. method:: Target.write_value(path, value [, verify])
|
||||
.. method:: Target.write_value(path, value [, verify, as_root])
|
||||
|
||||
Write the value to the specified path on the target. This is primarily
|
||||
intended for sysfs/procfs/debugfs etc.
|
||||
@@ -397,8 +397,10 @@ Target
|
||||
it is written to make sure it has been written successfully. This due to
|
||||
some sysfs entries silently failing to set the written value without
|
||||
returning an error code.
|
||||
:param as_root: specifies if writing requires being root. Its default value
|
||||
is ``True``.
|
||||
|
||||
.. method:: Target.revertable_write_value(path, value [, verify])
|
||||
.. method:: Target.revertable_write_value(path, value [, verify, as_root])
|
||||
|
||||
Same as :meth:`Target.write_value`, but as a context manager that will write
|
||||
back the previous value on exit.
|
||||
|
Reference in New Issue
Block a user