in scripts/setup_network_storage.py [0:0]
def resolve_network_storage(nodeset=None):
"""Combine appropriate network_storage fields to a single list"""
if lkp.instance_role == "compute":
try:
nodeset = lkp.node_nodeset()
except Exception:
# External nodename, skip lookup
nodeset = None
# seed mounts with the default controller mounts
if cfg.disable_default_mounts:
default_mounts = []
else:
default_mounts = [
NSDict(
{
"server_ip": lkp.control_addr or lkp.control_host,
"remote_mount": str(path),
"local_mount": str(path),
"fs_type": "nfs",
"mount_options": "defaults,hard,intr",
}
)
for path in (
dirs.home,
dirs.apps,
)
]
# create dict of mounts, local_mount: mount_info
mounts = mounts_by_local(default_mounts)
# On non-controller instances, entries in network_storage could overwrite
# default exports from the controller. Be careful, of course
mounts.update(mounts_by_local(cfg.network_storage))
if lkp.instance_role in ("login", "controller"):
mounts.update(mounts_by_local(cfg.login_network_storage))
if nodeset is not None:
mounts.update(mounts_by_local(nodeset.network_storage))
return list(mounts.values())