diff --git a/setup.py b/setup.py index b66eb91..7b6aa72 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ 'pyfakefs', 'pytest-mock' , 'fs', - 'moto', + 'moto<5', 'pytest-localftpserver' ] diff --git a/src/tesk_core/filer.py b/src/tesk_core/filer.py index d2fef8b..af6cf93 100755 --- a/src/tesk_core/filer.py +++ b/src/tesk_core/filer.py @@ -240,6 +240,7 @@ def delete(self): def ftp_login(ftp_connection, netloc, netrc_file): user = None + password=None if netrc_file is not None: creds = netrc_file.authenticators(netloc) if creds: diff --git a/src/tesk_core/taskmaster.py b/src/tesk_core/taskmaster.py index 0d1f182..4fd506d 100755 --- a/src/tesk_core/taskmaster.py +++ b/src/tesk_core/taskmaster.py @@ -28,8 +28,12 @@ def run_executor(executor, namespace, pvc=None): if pvc is not None: mounts = spec['containers'][0].setdefault('volumeMounts', []) mounts.extend(pvc.volume_mounts) - volumes = spec.setdefault('volumes', []) - volumes.extend([{'name': task_volume_basename, 'persistentVolumeClaim': { + spec.setdefault('volumes', []) + if spec['volumes'] is None: + spec['volumes'] = [] + # volumes is a refence to spec['volumes'] + # This makes sure the next line does not fail if volumes was originaly "null" + spec['volumes'].extend([{'name': task_volume_basename, 'persistentVolumeClaim': { 'readonly': False, 'claimName': pvc.name}}]) logger.debug('Created job: ' + jobname) job = Job(executor, jobname, namespace)