SABnzbd-Suite: rework: a failed part of suite should NEVER block another part.

This commit is contained in:
Stefan Saraev 2012-06-21 12:36:06 +03:00
parent 8dfbdba67b
commit ba695d3da3

View File

@ -182,9 +182,10 @@ except:
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
os.environ['PYTHONPATH'] = str(os.environ.get('PYTHONPATH')) + ':' + pPylib
# SABnzbd start
try:
# write SABnzbd settings
# ----------------------
sabNzbdConfig = ConfigObj(pSabNzbdSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['misc'] = {}
@ -258,10 +259,14 @@ if "true" in sabnzbd_launch:
sabNzbdConfig.reload()
sabNzbdApiKey = sabNzbdConfig['misc']['api_key']
logging.debug('SABnzbd api key: ' + sabNzbdApiKey)
except Exception,e:
print 'SABnzbd: exception occurred:', e
# SABnzbd end
# SickBeard start
try:
# write SickBeard settings
# ------------------------
sickBeardConfig = ConfigObj(pSickBeardSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['General'] = {}
@ -311,10 +316,14 @@ if "true" in sickbeard_launch:
logging.debug('Launching SickBeard...')
subprocess.call(sickBeard,close_fds=True)
logging.debug('...done')
except Exception,e:
print 'SickBeard: exception occurred:', e
# SickBeard end
# CouchPotato start
try:
# write CouchPotato settings
# --------------------------
couchPotatoConfig = ConfigObj(pCouchPotatoSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['global'] = {}
@ -355,13 +364,17 @@ if "true" in couchpotato_launch and "0" in couchpotato_version:
logging.debug('Launching CouchPotato...')
subprocess.call(couchPotato,close_fds=True)
logging.debug('...done')
except Exception,e:
print 'CouchPotato: exception occurred:', e
# CouchPotato end
# CouchPotatoServer start
try:
#convert password to md5
md5pwd = hashlib.md5(pwd).hexdigest()
# write CouchPotatoServer settings
# --------------------------
couchPotatoServerConfig = ConfigObj(pCouchPotatoServerSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['newznab'] = {}
@ -413,10 +426,14 @@ if "true" in couchpotato_launch and "1" in couchpotato_version:
logging.debug('Launching CouchPotatoServer...')
subprocess.call(couchPotatoServer,close_fds=True)
logging.debug('...done')
except Exception,e:
print 'CouchPotatoServer: exception occurred:', e
# CouchPotatoServer end
# Headphones start
try:
# write Headphones settings
# -------------------------
headphonesConfig = ConfigObj(pHeadphonesSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['General'] = {}
@ -449,3 +466,6 @@ if "true" in headphones_launch:
logging.debug('Launching Headphones...')
subprocess.call(headphones,close_fds=True)
logging.debug('...done')
except Exception,e:
print 'Headphones: exception occurred:', e
# Headphones end