Skip to content
Draft
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
1 change: 1 addition & 0 deletions mig/server/grid_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Check warning on line 23 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (81 > 80 characters)
#
# -- END_HEADER ---
#
Expand Down Expand Up @@ -69,7 +69,7 @@
from scandir import scandir, __version__ as scandir_version
if StrictVersion(scandir_version) < StrictVersion("1.3"):

# Important os.walk compatibility utf8 fixes were not added until 1.3

Check warning on line 72 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (81 > 80 characters)

raise ImportError('scandir version is too old >= 1.3 required')
except ImportError as exc:
Expand All @@ -90,7 +90,7 @@
from mig.shared.logger import daemon_logger, register_hangup_handler
from mig.shared.safeinput import PARAM_START, PARAM_STOP, PARAM_JUMP
from mig.shared.serial import load
from mig.shared.vgrid import vgrid_valid_entities, vgrid_add_workflow_jobs, \

Check warning on line 93 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (81 > 80 characters)
JOB_ID, JOB_CLIENT
from mig.shared.vgridaccess import check_vgrid_access
from mig.shared.workflows import get_wp_map, CONF
Expand All @@ -100,8 +100,8 @@

# Global trigger rule dictionaries with rules for all VGrids

all_rules = {}

Check failure on line 103 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Need type annotation for "all_rules" (hint: "all_rules: Dict[<type>, <type>] = ...") [var-annotated]
rule_hits = {}

Check failure on line 104 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Need type annotation for "rule_hits" (hint: "rule_hits: Dict[<type>, <type>] = ...") [var-annotated]
dir_cache = {}

# Global miss cache to avoid wasting energy on repeated events without triggers
Expand All @@ -110,15 +110,15 @@

# Global state helpers used in a number of functions and methods

shared_state = {}

Check failure on line 113 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Need type annotation for "shared_state" (hint: "shared_state: Dict[<type>, <type>] = ...") [var-annotated]
shared_state['base_dir'] = None
shared_state['base_dir_len'] = 0
shared_state['writable_dir'] = None

Check failure on line 116 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Incompatible types in assignment (expression has type "None", target has type "int") [assignment]
shared_state['writable_dir_len'] = 0
shared_state['file_inotify'] = None

Check failure on line 118 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Incompatible types in assignment (expression has type "None", target has type "int") [assignment]
shared_state['file_handler'] = None

Check failure on line 119 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Incompatible types in assignment (expression has type "None", target has type "int") [assignment]
shared_state['rule_handler'] = None

Check failure on line 120 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Incompatible types in assignment (expression has type "None", target has type "int") [assignment]
shared_state['rule_inotify'] = None

Check failure on line 121 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Incompatible types in assignment (expression has type "None", target has type "int") [assignment]

# Only cache rule misses for one minute at a time to catch rule updates.
# Run complete expire cycle if miss cache exceeds expire size.
Expand Down Expand Up @@ -530,7 +530,7 @@

if state == 'created':

# logger.debug('(%s) Updating rule monitor for src_path: %s, event: %s'

Check warning on line 533 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (83 > 80 characters)
# % (pid, src_path, state))

print('(%s) Updating rule monitor for src_path: %s, event: %s'
Expand All @@ -554,7 +554,7 @@
for ent in scandir(src_path):
if ent.is_dir(follow_symlinks=True):

# logger.debug('(%s) Dispatch DirCreatedEvent for: %s'

Check warning on line 557 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (82 > 80 characters)
# % (pid, ent.path))

shared_state['rule_handler'].dispatch(
Expand All @@ -562,14 +562,14 @@
elif ent.path.find(configuration.vgrid_triggers) \
> -1:

# logger.debug('(%s) Dispatch FileCreatedEvent for: %s'

Check warning on line 565 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (83 > 80 characters)
# % (pid, ent.path))

shared_state['rule_handler'].dispatch(
FileCreatedEvent(ent.path))

# else:
# logger.debug('(%s) rule_monitor watch already exists for: %s'

Check warning on line 572 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (82 > 80 characters)
# % (pid, src_path))
# else:
# logger.debug('(%s) unhandled event: %s for: %s' % (pid,
Expand Down Expand Up @@ -605,7 +605,7 @@
except Exception as exc:
new_rules = []
if state != 'deleted':
logger.error('(%s) failed to load event handler rules from %s (%s)'

Check warning on line 608 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (87 > 80 characters)
% (pid, src_path, exc))

# logger.debug("(%s) loaded new rules from '%s':\n%s" % (pid,
Expand All @@ -616,7 +616,7 @@

for target_path in all_rules:
all_rules[target_path] = [i for i in
all_rules[target_path] if i['vgrid_name']

Check warning on line 619 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (83 > 80 characters)
!= vgrid_name]
remain_rules = [i for i in all_rules[target_path]
if i['vgrid_name'] != vgrid_name]
Expand Down Expand Up @@ -973,7 +973,7 @@
# created.
if pattern['parameterize_over']:
all_values = []
for (var, sweep) in pattern['parameterize_over'].items():

Check warning on line 976 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (81 > 80 characters)

start = float(sweep[PARAM_START])
stop = float(sweep[PARAM_STOP])
Expand Down Expand Up @@ -2000,8 +2000,8 @@
# else:
# logger.debug('Skipping _NON_ vgrid: %s' % ent.path)

for monitor in vgrid_monitors.values():

Check failure on line 2003 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

Incompatible types in assignment (expression has type "Process", variable has type "Callable[[Any, Any], Any]") [assignment]
monitor.start()

Check failure on line 2004 in mig/server/grid_events.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

"Callable[[Any, Any], Any]" has no attribute "start" [attr-defined]

logger.debug('(%s) Starting main loop' % main_pid)
print("%s: Start main loop" % os.getpid())
Expand Down Expand Up @@ -2044,3 +2044,4 @@
logger.info('(%s) Event handler daemon shutting down' % main_pid)

sys.exit(0)

1 change: 1 addition & 0 deletions mig/server/grid_ftps.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,3 +619,4 @@ def start_service(conf):
info_msg = "Leaving with no more workers active"
logger.info(info_msg)
print(info_msg)

1 change: 1 addition & 0 deletions mig/server/grid_openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1792,3 +1792,4 @@ def start_service(configuration):
info_msg = "Leaving with no more workers active"
logger.info(info_msg)
print(info_msg)

1 change: 1 addition & 0 deletions mig/server/grid_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,3 +1742,4 @@ def graceful_shutdown():
sys.stdout.flush()
loop_counter += 1
logger.debug('loop ended')

1 change: 1 addition & 0 deletions mig/server/grid_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2135,3 +2135,4 @@ def start_service(configuration):
info_msg = "Leaving with no more workers active"
logger.info(info_msg)
print(info_msg)

1 change: 1 addition & 0 deletions mig/server/grid_webdavs-3.x.py
Original file line number Diff line number Diff line change
Expand Up @@ -2139,3 +2139,4 @@ def run(configuration):
except Exception as exc:
logger.error("exiting on unexpected exception: %s" % exc)
logger.info(traceback.format_exc())

Loading