-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Use dedicated script to set up DiracX in the CS
- Loading branch information
Showing
3 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python | ||
import argparse | ||
|
||
import DIRAC | ||
from DIRAC.Core.Utilities.ReturnValues import returnValueOrRaise | ||
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Setup DIRAC CS for running integration tests with DiracX") | ||
parser.add_argument("--disable-vo", nargs="+", help="Disable a VO", default=[]) | ||
parser.add_argument("--url", help="URL of the DiracX services") | ||
args = parser.parse_args() | ||
|
||
DIRAC.initialize() | ||
|
||
main(args.url, args.disable_vo) | ||
|
||
|
||
def main(url: str, disabled_vos: list[str]): | ||
from DIRAC.ConfigurationSystem.Client.CSAPI import CSAPI | ||
|
||
csAPI = CSAPI() | ||
|
||
returnValueOrRaise(csAPI.createSection("DiracX")) | ||
|
||
if url: | ||
returnValueOrRaise(csAPI.setOption("DiracX/URL", url)) | ||
|
||
if disabled_vos: | ||
returnValueOrRaise(csAPI.setOption("DiracX/DisabledVOs", ",".join(disabled_vos))) | ||
|
||
returnValueOrRaise(csAPI.commit()) | ||
|
||
|
||
if __name__ == "__main__": | ||
parse_args() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters