Loading services/webapp/code/rosetta/core_app/api.py +1 −1 Original line number Diff line number Diff line Loading @@ -441,7 +441,7 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI): if computing.auth_mode == 'user_keys': computing_user = user.profile.get_extra_conf('computing_user', storage.computing) if not computing_user: raise Exception('Computing resource \'{}\' user is not configured'.format(storage.computing.name)) raise ValueError('No \'computing_user\' parameter found for computing resource \'{}\' in user profile'.format(storage.computing.name)) base_path_expanded = base_path_expanded.replace('$SSH_USER', computing_user) else: base_path_expanded = base_path_expanded.replace('$SSH_USER', computing.conf.get('user')) Loading services/webapp/code/rosetta/core_app/models.py +8 −2 Original line number Diff line number Diff line Loading @@ -246,13 +246,19 @@ class Computing(models.Model): managers_mapping = {} managers_mapping['cluster'+'ssh+cli'+'user_keys'+'slurm'] = computing_managers.SlurmSSHClusterComputingManager managers_mapping['standalone'+'ssh+cli'+'user_keys'+'None'] = computing_managers.SSHStandaloneComputingManager managers_mapping['standalone'+'ssh+cli'+'platform_keys'+'None'] = computing_managers.SSHStandaloneComputingManager managers_mapping['standalone'+'internal'+'internal'+'None'] = computing_managers.InternalStandaloneComputingManager # Instantiate the computing manager and return (if not already done) try: return self._manager except AttributeError: try: self._manager = managers_mapping[self.type+self.access_mode+self.auth_mode+str(self.wms)](self) except KeyError: raise ValueError('No computing resource manager for type="{}", access_mode="{}", auth_mode="{}", wms="{}"' .format(self.type, self.access_mode, self.auth_mode, self.wms)) from None else: return self._manager Loading services/webapp/code/rosetta/core_app/utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -715,13 +715,13 @@ def get_ssh_access_mode_credentials(computing, user): except AttributeError: computing_host = None if not computing_host: raise Exception('No computing host?!') raise ValueError('No computing host?!') # Get computing user and keys if computing.auth_mode == 'user_keys': computing_user = user.profile.get_extra_conf('computing_user', computing) if not computing_user: raise Exception('Computing resource \'{}\' user is not configured'.format(computing.name)) raise ValueError('No \'computing_user\' parameter found for computing resource \'{}\' in user profile'.format(computing.name)) # Get user key computing_keys = KeyPair.objects.get(user=user, default=True) elif computing.auth_mode == 'platform_keys': Loading @@ -730,7 +730,7 @@ def get_ssh_access_mode_credentials(computing, user): else: raise NotImplementedError('Auth modes other than user_keys and platform_keys not supported.') if not computing_user: raise Exception('No computing user?!') raise ValueError('No \'user\' parameter found for computing resource \'{}\' in its configuration'.format(computing.name)) return (computing_user, computing_host, computing_keys) Loading Loading
services/webapp/code/rosetta/core_app/api.py +1 −1 Original line number Diff line number Diff line Loading @@ -441,7 +441,7 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI): if computing.auth_mode == 'user_keys': computing_user = user.profile.get_extra_conf('computing_user', storage.computing) if not computing_user: raise Exception('Computing resource \'{}\' user is not configured'.format(storage.computing.name)) raise ValueError('No \'computing_user\' parameter found for computing resource \'{}\' in user profile'.format(storage.computing.name)) base_path_expanded = base_path_expanded.replace('$SSH_USER', computing_user) else: base_path_expanded = base_path_expanded.replace('$SSH_USER', computing.conf.get('user')) Loading
services/webapp/code/rosetta/core_app/models.py +8 −2 Original line number Diff line number Diff line Loading @@ -246,13 +246,19 @@ class Computing(models.Model): managers_mapping = {} managers_mapping['cluster'+'ssh+cli'+'user_keys'+'slurm'] = computing_managers.SlurmSSHClusterComputingManager managers_mapping['standalone'+'ssh+cli'+'user_keys'+'None'] = computing_managers.SSHStandaloneComputingManager managers_mapping['standalone'+'ssh+cli'+'platform_keys'+'None'] = computing_managers.SSHStandaloneComputingManager managers_mapping['standalone'+'internal'+'internal'+'None'] = computing_managers.InternalStandaloneComputingManager # Instantiate the computing manager and return (if not already done) try: return self._manager except AttributeError: try: self._manager = managers_mapping[self.type+self.access_mode+self.auth_mode+str(self.wms)](self) except KeyError: raise ValueError('No computing resource manager for type="{}", access_mode="{}", auth_mode="{}", wms="{}"' .format(self.type, self.access_mode, self.auth_mode, self.wms)) from None else: return self._manager Loading
services/webapp/code/rosetta/core_app/utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -715,13 +715,13 @@ def get_ssh_access_mode_credentials(computing, user): except AttributeError: computing_host = None if not computing_host: raise Exception('No computing host?!') raise ValueError('No computing host?!') # Get computing user and keys if computing.auth_mode == 'user_keys': computing_user = user.profile.get_extra_conf('computing_user', computing) if not computing_user: raise Exception('Computing resource \'{}\' user is not configured'.format(computing.name)) raise ValueError('No \'computing_user\' parameter found for computing resource \'{}\' in user profile'.format(computing.name)) # Get user key computing_keys = KeyPair.objects.get(user=user, default=True) elif computing.auth_mode == 'platform_keys': Loading @@ -730,7 +730,7 @@ def get_ssh_access_mode_credentials(computing, user): else: raise NotImplementedError('Auth modes other than user_keys and platform_keys not supported.') if not computing_user: raise Exception('No computing user?!') raise ValueError('No \'user\' parameter found for computing resource \'{}\' in its configuration'.format(computing.name)) return (computing_user, computing_host, computing_keys) Loading