pkg/storaged/stratis/stratis3-set-key.py
raw| 1 | # SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 | import sys |
| 3 | |
| 4 | import dbus |
| 5 | |
| 6 | reply = dbus.SystemBus().call_blocking('org.storage.stratis3', '/org/storage/stratis3', |
| 7 | 'org.storage.stratis3.Manager.r0', 'SetKey', |
| 8 | 'sh', [sys.argv[1], 0]) |
| 9 | if reply[1] != 0: |
| 10 | sys.stderr.write(reply[2] + '\n') |
| 11 | sys.exit(1) |