fix allowed_during_startup

This commit is contained in:
Jack Robison 2017-07-19 11:42:17 -04:00
parent d3bf097687
commit 4e5ff49177
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
4 changed files with 9 additions and 5 deletions

View file

@ -25,6 +25,7 @@ at anytime.
* Fixed daemon process hanging when started without an internet connection * Fixed daemon process hanging when started without an internet connection
* Fixed https://github.com/lbryio/lbry/issues/774 * Fixed https://github.com/lbryio/lbry/issues/774
* Fix XDG compliance on Linux * Fix XDG compliance on Linux
* Fixed https://github.com/lbryio/lbry/issues/760
### Deprecated ### Deprecated
* *

View file

@ -165,11 +165,12 @@ class Daemon(AuthJSONRPCServer):
LBRYnet daemon, a jsonrpc interface to lbry functions LBRYnet daemon, a jsonrpc interface to lbry functions
""" """
allowed_during_startup = [
'daemon_stop', 'status', 'version',
]
def __init__(self, root, analytics_manager): def __init__(self, root, analytics_manager):
AuthJSONRPCServer.__init__(self, conf.settings['use_auth_http']) AuthJSONRPCServer.__init__(self, conf.settings['use_auth_http'])
self.allowed_during_startup = [
'stop', 'status', 'version',
]
self.db_dir = conf.settings['data_dir'] self.db_dir = conf.settings['data_dir']
self.download_directory = conf.settings['download_directory'] self.download_directory = conf.settings['download_directory']
if conf.settings['BLOBFILES_DIR'] == "blobfiles": if conf.settings['BLOBFILES_DIR'] == "blobfiles":

View file

@ -82,7 +82,9 @@ def main():
suggest_help=False) suggest_help=False)
return 1 return 1
if status['startup_status']['code'] != "started": status_code = status['startup_status']['code']
if status_code != "started" and method not in Daemon.allowed_during_startup:
print "Daemon is in the process of starting. Please try again in a bit." print "Daemon is in the process of starting. Please try again in a bit."
message = status['startup_status']['message'] message = status['startup_status']['message']
if message: if message:

View file

@ -192,6 +192,7 @@ class AuthJSONRPCServer(AuthorizedBase):
implements(resource.IResource) implements(resource.IResource)
isLeaf = True isLeaf = True
allowed_during_startup = []
def __init__(self, use_authentication=None): def __init__(self, use_authentication=None):
self._call_lock = {} self._call_lock = {}
@ -199,7 +200,6 @@ class AuthJSONRPCServer(AuthorizedBase):
use_authentication if use_authentication is not None else conf.settings['use_auth_http'] use_authentication if use_authentication is not None else conf.settings['use_auth_http']
) )
self.announced_startup = False self.announced_startup = False
self.allowed_during_startup = []
self.sessions = {} self.sessions = {}
def setup(self): def setup(self):