diff options
| author | Jonathan Cave <jonathan.cave@canonical.com> | 2019-10-25 12:38:56 +0100 |
|---|---|---|
| committer | Jonathan Cave <jonathan.cave@canonical.com> | 2019-10-25 12:38:56 +0100 |
| commit | 5812e81b0118e0b2e9e668ed40d067725b529b50 (patch) | |
| tree | 9a7c284d948faf4de968dbbfcade5e556d297972 /bin | |
| parent | 4264cd8b8f4f5fa22f7c91e72d08987a9f8f7b93 (diff) | |
wifi_nmcli_backup: always create the backup dir
This ensures that the restore job will pass in the case when there are no connections prior to running the save job
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/wifi_nmcli_backup.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/wifi_nmcli_backup.py b/bin/wifi_nmcli_backup.py index 6e4db6a..61bd759 100755 --- a/bin/wifi_nmcli_backup.py +++ b/bin/wifi_nmcli_backup.py @@ -62,11 +62,11 @@ def reload_nm_connections(): def save_connections(keyfile_list): + if not os.path.exists(SAVE_DIR): + os.makedirs(SAVE_DIR) if len(keyfile_list) == 0: print('No stored 802.11 connections to save') return - if not os.path.exists(SAVE_DIR): - os.makedirs(SAVE_DIR) for f in keyfile_list: print('Save connection {}'.format(f)) if not os.path.exists(f): |
