mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Restart after resetting git install
This commit is contained in:
parent
42e33a0468
commit
8d67cc4c5a
5 changed files with 18 additions and 13 deletions
|
@ -2077,7 +2077,7 @@ def upgrade():
|
|||
libraries.update_libraries_db_notify()
|
||||
|
||||
|
||||
def shutdown(restart=False, update=False, checkout=False):
|
||||
def shutdown(restart=False, update=False, checkout=False, reset=False):
|
||||
webstart.stop()
|
||||
|
||||
# Shutdown the websocket connection
|
||||
|
@ -2112,6 +2112,13 @@ def shutdown(restart=False, update=False, checkout=False):
|
|||
except Exception as e:
|
||||
logger.warn(u"Tautulli failed to switch git branch: %s. Restarting." % e)
|
||||
|
||||
if reset:
|
||||
logger.info(u"Tautulli is resetting the git install...")
|
||||
try:
|
||||
versioncheck.reset_git_install()
|
||||
except Exception as e:
|
||||
logger.warn(u"Tautulli failed to reset git install: %s. Restarting." % e)
|
||||
|
||||
if CREATEPID:
|
||||
logger.info(u"Removing pidfile %s", PIDFILE)
|
||||
os.remove(PIDFILE)
|
||||
|
|
|
@ -328,7 +328,7 @@ def update():
|
|||
return
|
||||
|
||||
|
||||
def reset():
|
||||
def reset_git_install():
|
||||
if plexpy.INSTALL_TYPE == 'git':
|
||||
logger.info('Attempting to reset git install to "%s/%s"' % (plexpy.CONFIG.GIT_REMOTE, plexpy.CONFIG.GIT_BRANCH))
|
||||
output, err = runGit('remote set-url {} https://github.com/{}/{}.git'.format(plexpy.CONFIG.GIT_REMOTE,
|
||||
|
|
|
@ -3920,16 +3920,9 @@ class WebInterface(object):
|
|||
return self.do_state_change('checkout', 'Switching Git Branches', 120)
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
def reset_git_install(self, **kwargs):
|
||||
result = versioncheck.reset()
|
||||
|
||||
if result:
|
||||
return {'result': 'success', 'message': 'Tautulli installation reset.'}
|
||||
else:
|
||||
return {'result': 'error', 'message': 'Reset installation failed.'}
|
||||
|
||||
return self.do_state_change('reset', 'Resetting Git Install', 120)
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue