Converts a numeric dbus snapper status into a string CLI Example: .. code-block:: bash salt '*' snapper.status_to_string
(dbus_status)
| 260 | |
| 261 | |
| 262 | def status_to_string(dbus_status): |
| 263 | """ |
| 264 | Converts a numeric dbus snapper status into a string |
| 265 | |
| 266 | CLI Example: |
| 267 | |
| 268 | .. code-block:: bash |
| 269 | |
| 270 | salt '*' snapper.status_to_string <dbus_status> |
| 271 | """ |
| 272 | status_tuple = ( |
| 273 | dbus_status & 0b000000001, |
| 274 | dbus_status & 0b000000010, |
| 275 | dbus_status & 0b000000100, |
| 276 | dbus_status & 0b000001000, |
| 277 | dbus_status & 0b000010000, |
| 278 | dbus_status & 0b000100000, |
| 279 | dbus_status & 0b001000000, |
| 280 | dbus_status & 0b010000000, |
| 281 | dbus_status & 0b100000000, |
| 282 | ) |
| 283 | |
| 284 | return [DBUS_STATUS_MAP[status] for status in status_tuple if status] |
| 285 | |
| 286 | |
| 287 | def get_config(name="root"): |