Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed flux import. #677

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Changes from 1 commit
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
21 changes: 20 additions & 1 deletion lib/pavilion/schedulers/plugins/flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


# Just import flux once
HAS_FLUX = False
try:
import flux
import flux.hostlist
Expand All @@ -30,7 +31,25 @@
from flux.job import JobspecV1
HAS_FLUX = True
except ImportError:
HAS_FLUX = False
_minor_version = sys.version_info.minor
_flux_path = None
for i in range(_minor_version, 5, -1):
_flux_path = "/usr/lib64/flux/python3.{}".format(_minor_version)
if os.path.exists(_flux_path):
break

if _flux_path is not None:
sys.path.append(_flux_path)
try:
import flux
import flux.hostlist
import flux.job
import flux.resource
from flux.job import JobspecV1
HAS_FLUX = True
except ImportError:
pass


flux_states = [
"DEPEND",
Expand Down
Loading