reformat multiline strings; don't output "storage.plugins = None"

This commit is contained in:
meejah 2023-08-10 12:06:29 -06:00
parent 5d93b51e28
commit 09ea172b94

View File

@ -307,13 +307,18 @@ class UseNode(object):
if self.plugin_config is None:
plugin_config_section = ""
else:
plugin_config_section = """
[storageclient.plugins.{storage_plugin}]
{config}
""".format(
plugin_config_section =
"[storageclient.plugins.{storage_plugin}]\n"
"{config}\n"
.format(
storage_plugin=self.storage_plugin,
config=format_config_items(self.plugin_config),
)
)
if self.storage_plugin is None:
plugins = ""
else:
plugins = "storage.plugins = {}".format(self.storage_plugin)
write_introducer(
self.basedir,
@ -340,18 +345,17 @@ class UseNode(object):
self.config = config_from_string(
self.basedir.asTextMode().path,
"tub.port",
"""
[node]
{node_config}
[client]
storage.plugins = {storage_plugin}
{plugin_config_section}
""".format(
storage_plugin=self.storage_plugin,
"[node]\n"
"{node_config}\n"
"\n"
"[client]\n"
"{plugins}\n"
"{plugin_config_section}\n"
.format(
plugins=plugins,
node_config=format_config_items(node_config),
plugin_config_section=plugin_config_section,
)
)
)
def create_node(self):