def write_config(self, initialize_indices=False):
if not os.path.exists(self.config_dir):<EOL><INDENT>os.mkdir(self.config_dir)<EOL><DEDENT>with open(self.config_file, '<STR_LIT:w>') as configfile:<EOL><INDENT>self.config.write(configfile)<EOL><DEDENT>if initialize_indices:<EOL><INDENT>index = self.get('<STR_LIT>', '<STR_LIT:index>')<EOL>from jackal import Host, Range, Service, User, Credential, Log<EOL>from jackal.core import create_connection<EOL>create_connection(self)<EOL>Host.init(index="<STR_LIT>".format(index))<EOL>Range.init(index="<STR_LIT>".format(index))<EOL>Service.init(index="<STR_LIT>".format(index))<EOL>User.init(index="<STR_LIT>".format(index))<EOL>Credential.init(index="<STR_LIT>".format(index))<EOL>Log.init(index="<STR_LIT>".format(index))<EOL><DEDENT>
Write the current config to disk to store them.