22
33Command to retrieve and cache the free/total disk space of a Storage Element.
44
5- The unit and decision thresholds are read from ``self.args`` (populated from the
6- Operations CS ``/Operations/Defaults/ResourceStatus/Policies/FreeDiskSpace``) :
5+ The unit and decision thresholds are read from ``self.args``, which are populated
6+ by the policy engine from ``POLICIESMETA`` defaults and any CS overrides :
77
8- * ``unit`` — space unit for the occupancy query: ``TB`` (default) , ``GB`` or ``MB``
9- * ``Banned_threshold`` — free-space value below which the SE is Banned (default: 0.1)
10- * ``Degraded_threshold`` — free-space value below which the SE is Degraded (default: 5)
8+ * ``unit`` — space unit for the occupancy query ( ``TB``, ``GB`` or ``MB``)
9+ * ``Banned_threshold`` — free-space value below which the SE is Banned
10+ * ``Degraded_threshold`` — free-space value below which the SE is Degraded
1111
1212Note: there are still many references to "space tokens" (e.g.
1313``ResourceManagementClient().selectSpaceTokenOccupancyCache(token=elementName)``).
@@ -52,11 +52,11 @@ def _prepareCommand(self):
5252
5353 * ``name`` (str) — Storage Element name.
5454
55- Optional keys (all read from the FreeDiskSpace policy configuration ):
55+ Optional keys (populated from ``POLICIESMETA`` defaults and CS overrides ):
5656
57- * ``unit`` (str) — space unit: ``TB`` (default) , ``GB`` or ``MB``.
58- * ``Banned_threshold`` (float) — free space below which the SE is Banned (default: 0.1) .
59- * ``Degraded_threshold`` (float) — free space below which the SE is Degraded (default: 5) .
57+ * ``unit`` (str) — space unit: ``TB``, ``GB`` or ``MB``.
58+ * ``Banned_threshold`` (float) — free space below which the SE is Banned.
59+ * ``Degraded_threshold`` (float) — free space below which the SE is Degraded.
6060
6161 :returns: S_OK tuple ``(elementName, unit, banned_threshold, degraded_threshold)``
6262 or S_ERROR if ``name`` is missing.
@@ -66,10 +66,9 @@ def _prepareCommand(self):
6666 return S_ERROR ('"name" not found in self.args' )
6767 elementName = self .args ["name" ]
6868
69- unit = self .args .get ("unit" , "TB" )
70-
71- banned_threshold = self .args .get ("Banned_threshold" , 0.1 )
72- degraded_threshold = self .args .get ("Degraded_threshold" , 5 )
69+ unit = self .args ["unit" ]
70+ banned_threshold = self .args ["Banned_threshold" ]
71+ degraded_threshold = self .args ["Degraded_threshold" ]
7372
7473 return S_OK ((elementName , unit , banned_threshold , degraded_threshold ))
7574
@@ -91,8 +90,8 @@ def doNew(self, masterParams=None):
9190
9291 if masterParams is not None :
9392 elementName , unit = masterParams
94- banned_threshold = self .args . get ( "Banned_threshold" , 0.1 )
95- degraded_threshold = self .args . get ( "Degraded_threshold" , 5 )
93+ banned_threshold = self .args [ "Banned_threshold" ]
94+ degraded_threshold = self .args [ "Degraded_threshold" ]
9695 else :
9796 params = self ._prepareCommand ()
9897 if not params ["OK" ]:
0 commit comments