Added more error checking code to migratecfg

This commit is contained in:
echel0n 2014-04-03 20:14:15 -07:00
commit cf0b2aae7c

View file

@ -5,6 +5,8 @@ from nzbtomedia.nzbToMediaConfig import config
class migratecfg: class migratecfg:
def migrate(self): def migrate(self):
categories = [] categories = []
confignew = None
configold = None
try: try:
# check for autoProcessMedia.cfg and create if it does not exist # check for autoProcessMedia.cfg and create if it does not exist
@ -21,7 +23,7 @@ class migratecfg:
except:pass except:pass
# check for autoProcessMedia.cfg and autoProcessMedia.cfg.sample and if they don't exist return and fail # check for autoProcessMedia.cfg and autoProcessMedia.cfg.sample and if they don't exist return and fail
if not config() and not config(config.SAMPLE_CONFIG_FILE): if not config() and not config(config.SAMPLE_CONFIG_FILE) or not confignew or not configold:
return False return False
section = "CouchPotato" section = "CouchPotato"