def list_transport_options(transport_type): from aiida.plugins import TransportFactory options_list = [ create_option(*item) for item in TransportFactory(transport_type).auth_options.items() ] return options_list
def get_transport_class(self): """ Get the transport class for this computer. Can be used to instantiate a transport instance. :return: the transport class """ try: return TransportFactory(self.transport_type) except exceptions.EntryPointError as exception: raise exceptions.ConfigurationError( f'No transport found for {self.label} [type {self.transport_type}], message: {exception}' )
def get_transport_class(self): """ Get the transport class for this computer. Can be used to instantiate a transport instance. :return: the transport class """ try: return TransportFactory(self.get_transport_type()) except exceptions.EntryPointError as exception: raise exceptions.ConfigurationError( 'No transport found for {} [type {}], message: {}'.format( self.name, self.get_transport_type(), exception ) )
def get_transport(self): """Return a fully configured transport that can be used to connect to the computer set for this instance. :rtype: :class:`aiida.transports.Transport` """ computer = self.computer transport_type = computer.get_transport_type() try: transport_class = TransportFactory(transport_type) except exceptions.EntryPointError as exception: raise exceptions.ConfigurationError( 'transport type `{}` could not be loaded: {}'.format( transport_type, exception)) return transport_class(machine=computer.hostname, **self.get_auth_params())