Fix store and database config option names

This commit is contained in:
Andrew Morgan 2020-08-16 16:17:57 +01:00
parent ec25fead72
commit 95aa7943c1
2 changed files with 10 additions and 10 deletions

View file

@ -52,17 +52,17 @@ class Config(object):
logger.addHandler(handler) logger.addHandler(handler)
# Storage setup # Storage setup
self.store_filepath = self._get_cfg( self.store_path = self._get_cfg(
["storage", "store_filepath"], required=True ["storage", "store_path"], required=True
) )
# Create the store folder if it doesn't exist # Create the store folder if it doesn't exist
if not os.path.isdir(self.store_filepath): if not os.path.isdir(self.store_path):
if not os.path.exists(self.store_filepath): if not os.path.exists(self.store_path):
os.mkdir(self.store_filepath) os.mkdir(self.store_path)
else: else:
raise ConfigError( raise ConfigError(
f"storage.store_filepath '{self.store_filepath}' is not a directory" f"storage.store_path '{self.store_path}' is not a directory"
) )
# Database setup # Database setup

View file

@ -26,10 +26,10 @@ async def main():
# A different config file path can be specified as the first command line argument # A different config file path can be specified as the first command line argument
if len(sys.argv) > 1: if len(sys.argv) > 1:
config_filepath = sys.argv[1] config_path = sys.argv[1]
else: else:
config_filepath = "config.yaml" config_path = "config.yaml"
config = Config(config_filepath) config = Config(config_path)
# Configure the database # Configure the database
store = Storage(config) store = Storage(config)
@ -47,7 +47,7 @@ async def main():
config.homeserver_url, config.homeserver_url,
config.user_id, config.user_id,
device_id=config.device_id, device_id=config.device_id,
store_path=config.store_filepath, store_path=config.store_path,
config=client_config, config=client_config,
) )