28 Commits

Author SHA1 Message Date
Pascal Vizeli
f6bf44de1c
Add tests for remove function (#2309) 2020-11-29 12:34:33 +01:00
Pascal Vizeli
c4847ad10d
Handle dbus single byte (#2237) 2020-11-11 13:09:13 +01:00
Pascal Vizeli
35b626a1c5
Fix gvariant bytes array (#2162) 2020-10-22 15:56:32 +02:00
Joakim Sørensen
17559bfc8e
Extract exception message from chain for API errors (#2100)
* Get message from excepiton chain

* cleanup
2020-10-06 15:53:58 +02:00
Joakim Sørensen
9dc2f43ffb
Handle both cases of bind failures (#2099) 2020-10-06 11:28:09 +02:00
Joakim Sørensen
f35b6d0b00
Set permissions on JSON files (#2093)
* Set 600 premissions on json files

* Add test

* Fix local tar tests

* Fix tar test in action

* Use pytest fixture for tmp_path in tests

* remove not needed things
2020-10-05 15:14:09 +02:00
Pascal Vizeli
0f54824cdb add one test more 2020-09-17 10:32:41 +00:00
Pascal Vizeli
15a8f40f6f add more test 2020-09-17 10:07:05 +00:00
Pascal Vizeli
78f63380f2
Handle exception chain on addon boot (#2063)
* Handle exception chain on addon boot

* fix import

* Add tests
2020-09-17 12:01:48 +02:00
Joakim Sørensen
c9db42583b
Capture typeerror exception (#2052) 2020-09-14 13:40:11 +02:00
Pascal Vizeli
7be508214a
gvariant: parse byte string (#2041)
* Parse byte string

* fix lint
2020-09-11 18:36:19 +02:00
Pascal Vizeli
2321890dde
Full support of bytes arrays on gvariant (#2024)
* Full support of bytes arrays on gvariant

* Fix overlay ssid

* cleanup ssid

* fix test
2020-09-07 16:34:20 +02:00
Joakim Sørensen
f32d17d924
Format API error messages (#1997) 2020-08-30 17:53:10 +02:00
Pascal Vizeli
a2821a98ad
Fix gvar for dbus if binary is not a string (#1984) 2020-08-27 17:04:14 +02:00
Pascal Vizeli
6db4c60f47
Fix byte parser (#1981) 2020-08-27 14:31:34 +02:00
Pascal Vizeli
1a3b369dd7
Update black 20.8b1 (#1976) 2020-08-26 23:01:29 +02:00
Pascal Vizeli
bb64dca6e6
Fix symlink snapshot (#1833)
* Fix symbolic link issue with snapshot

* Add tests

* fix symlink

* add encrypted test

* Modify x
2020-07-14 15:39:03 +02:00
Franck Nijhof
9eab92513a
Add QA/CI to Supervisor (#1814) 2020-07-05 20:20:29 +02:00
Maximilian Bösing
a3cf445c93
Bugfix: No such file or directory: '/data/homeassistant/home-assistant_v2.db-shm' (#1795)
* Do not use `tar_file.add` to recursively add backup folder

As the folders might contain files which are being removed temporarily (e.g. shared memory file of sqlite database), relying on `tar_file.add` becomes problematic as it crashes the whole backup process if a file does not exist anymore.
This becomes annoying, if the file which causes the error should be excluded by the filter.

To workaround this issue, we manually iterating over the files/directories and apply filters before passing the file or directory to the `tar_file.add` method. As per [documentation](https://docs.python.org/3/library/pathlib.html#pure-paths), pure path does not access the file system.

Fixes #779

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove unused import

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Applied code review suggestions

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Applied codestyle

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove `pathlib` util and move `is_excluded_by_filter` into `tar` utils

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Rename method

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Rename `origin_dir` to `origin_path` and apply `Path` typehint

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Codestyle

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Add comment why we add the directory even if we are iterating over all its items

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Use `atomic_contents_add` from tar utils to archive addon data

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove unused function `exclude_filter`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Remove unsecure default list value

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Some more codestyle

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Lowercase method name `Path.joinpath`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Fix codestyle and use proper variable

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Add test for `_is_excluded_by_filter`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>

* Update addon.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-06-26 11:36:49 +02:00
Franck Nijhof
1d83c0c77a
Update isort configuration and sorts imports in codebase (#1739)
* Add known first party to isort configuration

* Run isort on supervisor and tests folder
2020-05-21 13:30:54 +02:00
Martin Hjelmare
53fa8e48c0
Delint tests (#1720)
* Delint tarfile test

* Delint tests
2020-05-11 20:41:09 +02:00
Pascal Vizeli
4ac7f7dcf0
Rename Hass.io -> Supervisor (#1522)
* Rename Hass.io -> Supervisor

* part 2

* fix lint

* fix auth name
2020-02-21 17:55:41 +01:00
Pascal Vizeli
11811701d0
Add snapshot_exclude option (#1337)
* Add snapshot tar filter

* Add filter to add-on

* Fix bug

* Fix
2019-10-21 14:48:24 +02:00
Pascal Vizeli
05c8022db3
Check path on extractall (#1336)
* Check path on extractall

* code cleanup

* Add logger

* Fix issue

* Add tests
2019-10-21 12:23:00 +02:00
Pascal Vizeli
387d2dcc2e
Add support for gvariant annotations (#1258) 2019-08-23 13:41:17 +02:00
Pascal Vizeli
8b9cd4f122
Improve handling with nested objects (#1253) 2019-08-22 14:24:50 +02:00
Pascal Vizeli
c0e3ccdb83
Improve gdbus error handling (#1252)
* Improve gdbus error handling

* Fix logging type

* Detect no dbus

* Fix issue with complex

* Update hassio/dbus/__init__.py

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Update hassio/dbus/hostname.py

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Update hassio/dbus/rauc.py

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Update hassio/dbus/systemd.py

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Fix black
2019-08-22 12:48:02 +02:00
Pascal Vizeli
0a0d97b084
Support pip progress for HA 0.94 (#1113)
* Support pip progress for HA 0.94

* fix black

* add tests

* add test for adguard

* Fix lint
2019-06-05 14:46:03 +02:00