diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 5c5acfd..a616c03 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.1.a13" +__version__ = "4.4.1.a14" __codename__ = "Yeast Starter" diff --git a/cbpi/configFolder.py b/cbpi/configFolder.py index c46d28b..bbfc51b 100644 --- a/cbpi/configFolder.py +++ b/cbpi/configFolder.py @@ -46,16 +46,28 @@ class ConfigFolder: if os.path.exists(os.path.join(backupfile)) is True: print("***************************************************") print("Found backup of config. Starting restore") - required_content=['dashboard/', 'recipes/', 'upload/', 'config.json', 'config.yaml'] + required_content=['dashboard/', + 'recipes/', + 'upload/', + 'sensor.json', + 'actor.json', + 'kettle.json', + 'config.json', + 'craftbeerpi.template', + 'chromium.desktop', + 'config.yaml'] zip=zipfile.ZipFile(backupfile) zip_content_list = zip.namelist() zip_content = True + missing_content=[] print("Checking content of zip file") + for content in required_content: try: check = zip_content_list.index(content) except: zip_content = False + missing_content.append(content) if zip_content == True: print("Found correct content. Starting Restore process") @@ -78,7 +90,9 @@ class ConfigFolder: print("contents of restored_config.zip file have been restored.") print("in case of a partial backup you will still be prompted to run 'cbpi setup'.") else: + zip.close() print("Wrong Content in zip file. No restore possible") + print(f'These files are missing {missing_content}') print("renaming zip file so it will be ignored on the next start") try: os.rename(backupfile, os.path.join(self.configFolderPath, "UNRESTORABLE_restored_config.zip"))