Skip to content

Commit

Permalink
Merge pull request #7987 from DIRACGridBot/cherry-pick-2-132dc4094-in…
Browse files Browse the repository at this point in the history
…tegration

[sweep:integration] fix: dirac-rss-sync: flip the default status to Active
  • Loading branch information
chrisburr authored Jan 14, 2025
2 parents 8c7adc3 + 5b0f2dc commit 4008c04
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
17 changes: 4 additions & 13 deletions docs/source/AdministratorGuide/Systems/ResourceStatus/install.rst
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

0 comments on commit 4008c04

Please sign in to comment.