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

[sweep:integration] fix: dirac-rss-sync: flip the default status to Active #7987

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,17 @@ Copy over the values that we had on the CS for the StorageElements::

$ dirac-rss-sync --init -o LogLevel=VERBOSE

*WARNING*: If the StorageElement does not have a particular StatusType declared
*WARNING*: If the StorageElement does not have a particular StatusType declared, on the CS, this script will set it to Active.

*WARNING*: on the CS, this script will set it to Banned. If that happens, you will

*WARNING*: have to issue the dirac-rss-status script over the elements that need

*WARNING*: to be fixed.
You can check the status of the resources with the following command::

$ dirac-rss-list-status --element Resource --elementType StorageElement

--------------------
Set statuses by HAND
--------------------

In case you entered the WARNING ! on point 4, you may need to identify the
status of your StorageElements. Try to detect the Banned SEs using the
following::

$ dirac-rss-list-status --element Resource --elementType StorageElement --status Banned

If is there any SE to be modified, you can do it as follows::
If there is any SE status to be modified, you can do it as follows::

$ dirac-rss-set-status --element Resource --name CERN-USER --statusType ReadAccess --status Active --reason "Why not?"
# This matches all StatusTypes
Expand Down
6 changes: 3 additions & 3 deletions src/DIRAC/ResourceStatusSystem/scripts/dirac_rss_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
By default, it sets their Status to `Unknown`, StatusType to `all` and
reason to `Synchronized`. However, it can copy over the status on the CS to
the RSS. Important: If the StatusType is not defined on the CS, it will set
it to Banned !
it to Active !
"""
from DIRAC import S_OK
from DIRAC import exit as DIRACExit
Expand Down Expand Up @@ -44,7 +44,7 @@ def parseSwitches():

# Default values
switches.setdefault("element", None)
switches.setdefault("defaultStatus", "Banned")
switches.setdefault("defaultStatus", "Active")
if not switches["element"] in ("all", "Site", "Resource", "Node", None):
gLogger.error(f"Found {switches['element']} as element switch")
gLogger.error("Please, check documentation below")
Expand Down Expand Up @@ -242,7 +242,7 @@ def main():

registerSwitches()
switchDict = parseSwitches()
DEFAULT_STATUS = switchDict.get("defaultStatus", "Banned")
DEFAULT_STATUS = switchDict.get("defaultStatus", "Active")

# Run script
run()
Expand Down
6 changes: 3 additions & 3 deletions tests/Jenkins/dirac_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ fullInstallDIRAC() {

# populate RSS
echo "==> Populating RSS DB"
dirac-rss-sync --element Site -o LogLevel=VERBOSE
dirac-rss-sync --element Resource -o LogLevel=VERBOSE
dirac-rss-sync --element Site --defaultStatus Banned -o LogLevel=VERBOSE
dirac-rss-sync --element Resource --defaultStatus Banned -o LogLevel=VERBOSE
# init RSS
echo "==> Initializing status of sites and resources in RSS"
dirac-rss-sync --init -o LogLevel=VERBOSE
dirac-rss-sync --init --defaultStatus Banned -o LogLevel=VERBOSE
# Setting by hand
dirac-rss-set-status --element Resource --name ProductionSandboxSE --status Active --reason "Why not?"
dirac-rss-set-status --element Resource --name jenkins.cern.ch --status Active --reason "Why not?"
Expand Down
Loading