Skip to content

Commit

Permalink
Issue1159 (#1162)
Browse files Browse the repository at this point in the history
* missing word in warning message

* fix #1159 obvious error messages when no configurations match
  • Loading branch information
petersilva authored Aug 19, 2024
1 parent e74ac55 commit d6c5f00
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sarracenia/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ def finalize(self, component=None, config=None):
self.sleep=1

if self.runStateThreshold_hung < self.housekeeping:
logger.warning( f"{component}/{config} runStateThreshold_hung {self.runStateThreshold_hung} set lower than housekeeping {self.housekeeping}. sr3 sanity might think this flow is hung kill it too quickly.")
logger.warning( f"{component}/{config} runStateThreshold_hung {self.runStateThreshold_hung} set lower than housekeeping {self.housekeeping}. sr3 sanity might think this flow is hung and kill it too quickly.")

if self.vip and not features['vip']['present']:
logger.critical( f"{component}/{config} vip feature requested, but missing library: {' '.join(features['vip']['modules_needed'])} " )
Expand Down
38 changes: 31 additions & 7 deletions sarracenia/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,8 @@ def declare(self):
flow=None

def disable(self):
if len(self.filtered_configurations) == 0:
logging.error('%s configuration not found', self.leftovers)
if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f"{self.leftovers} configuration not found" )
return

for f in self.filtered_configurations:
Expand Down Expand Up @@ -1667,8 +1667,8 @@ def log(self):
self.run_command(['tail', '-f', lfn])

def enable(self):
if len(self.filtered_configurations) == 0:
logging.error('%s configuration not found', self.leftovers)
if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f'{self.leftovers} configuration not found' )
return
# declare exchanges first.
for f in self.filtered_configurations:
Expand Down Expand Up @@ -1791,6 +1791,10 @@ def foreground(self):

def cleanup(self) -> bool:

if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f'{self.leftovers} configuration not found' )
return

if len(self.filtered_configurations) > 1 :
if len(self.filtered_configurations) != self.options.dangerWillRobinson:
logging.error(
Expand Down Expand Up @@ -2065,8 +2069,8 @@ def config_show(self):

def remove(self):

if len(self.filtered_configurations) == 0:
logging.error("No configuration matched")
if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f"{self.leftovers} configuration not found" )
return

if len(self.filtered_configurations) > 1 :
Expand Down Expand Up @@ -2153,6 +2157,10 @@ def sanity(self):
:return:
"""
if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f"{self.leftovers} configuration not found" )
return

pcount = 0
kill_hung=[]
for f in self.filtered_configurations:
Expand Down Expand Up @@ -2236,6 +2244,10 @@ def start(self):
:return:
"""

if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f"{self.leftovers} configuration not found" )
return

pcount = 0
for f in self.filtered_configurations:

Expand Down Expand Up @@ -2282,13 +2294,16 @@ def stop(self):
return 0 on success, non-zero on failure.
"""

if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f"{self.leftovers} configuration not found" )
return

self._clean_missing_proc_state()

if len(self.procs) == 0:
print('no procs running...already stopped')
return


print('sending SIGTERM ', end='', flush=True)
pcount = 0
fg_instances = set()
Expand Down Expand Up @@ -2536,6 +2551,10 @@ def status(self):
""" v3 Printing prettier statuses for each component/configs found
"""

if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f"{self.leftovers} configuration not found" )
return

flowNameWidth=self.cumulative_stats['flowNameWidth']
latestTransferWidth=self.cumulative_stats['latestTransferWidth']

Expand Down Expand Up @@ -2879,6 +2898,11 @@ def overview(self):
:return:
"""

if len(self.leftovers) > 0 and not self._action_all_configs:
logging.error( f"{self.leftovers} configuration not found" )
return

bad = 0


Expand Down

0 comments on commit d6c5f00

Please sign in to comment.