Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/lsst/ctrl/execute/allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
self.configuration = configuration

condorInfoConfig = CondorInfoConfig()
condorInfoConfig.loadFromStream(ResourcePath(condorInfoFileName).read())
condorInfoConfig.load(condorInfoFileName)

self.platform = platform

Expand Down Expand Up @@ -164,7 +164,7 @@ def loadAllocationConfig(self, name: ResourcePathExpression, suffix):
if not (name_ := ResourcePath(name)).exists():
raise RuntimeError(f"{name_} was not found.")
allocationConfig = AllocationConfig()
allocationConfig.loadFromStream(name_.read())
allocationConfig.load(name_)

self.defaults["QUEUE"] = allocationConfig.platform.queue
self.defaults["EMAIL_NOTIFICATION"] = allocationConfig.platform.email
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ctrl/execute/condorInfoConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CondorInfoConfig(pexConfig.Config):
if __name__ == "__main__":
config = CondorInfoConfig()
filename = find_package_file("condor-info.py")
config.loadFromStream(filename.read())
config.load(filename)

for i in config.platform:
print(i)
7 changes: 1 addition & 6 deletions python/lsst/ctrl/execute/findPackageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import os
import sys

import lsst.utils
from lsst.resources import ResourcePath


Expand Down Expand Up @@ -77,21 +76,17 @@ def find_package_file(filename: str, kind: str = "config", platform: str | None

home_dir = os.getenv("HOME", "~")
xdg_config_home = os.getenv("XDG_CONFIG_HOME", "~/.config")
try:
platform_pkg_dir = lsst.utils.getPackageDir(f"ctrl_platform_{platform}")
except (LookupError, ValueError):
platform_pkg_dir = None

file_candidates = [
ResourcePath(home_dir).join(".lsst").join(_filename),
ResourcePath(xdg_config_home).join("lsst").join(_filename),
(ResourcePath(platform_pkg_dir).join("etc").join(kind).join(_filename) if platform_pkg_dir else None),
ResourcePath(sys.exec_prefix).join("etc").join(kind).join(_filename),
(
ResourcePath(f"resource://lsst.ctrl.platform.{platform}/etc/{kind}/{_filename}")
if platform
else None
),
(ResourcePath(f"eups://ctrl_platform_{platform}/{kind}/{_filename}") if platform else None),
ResourcePath(f"resource://lsst.ctrl.execute/etc/{kind}/{_filename}"),
]
try:
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ctrl/execute/libexec/allocateNodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main():
# load the CondorConfig file
execConfigName = find_package_file("execConfig.py", platform=platform)
configuration = CondorConfig()
configuration.loadFromStream(execConfigName.read())
configuration.load(execConfigName)

# create the plugin class
schedulerName = configuration.platform.scheduler
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/ctrl/execute/qCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def __init__(self, platform: str):
configFileName = find_package_file("condor-info.py")

condorInfoConfig = CondorInfoConfig()
condorInfoConfig.loadFromStream(configFileName.read())
condorInfoConfig.load(configFileName)

configName = find_package_file("pbsConfig.py", platform=platform)

allocationConfig = AllocationConfig()
allocationConfig.loadFromStream(configName.read())
allocationConfig.load(configName)

self.userName = condorInfoConfig.platform[platform].user.name

Expand Down
Loading