(self)
Disconnects the runspace pool, must be in the Opened state
Disconnects the runspace pool, must be in the Opened state
Disconnects the runspace pool must be in the Opened state
def disconnect(self):
        """
        Disconnects the runspace pool, must be in the Opened state
        """
        log.info("Disconnecting from Runspace Pool")
        if self.state == RunspacePoolState.DISCONNECTED:
            return
        elif self.state != RunspacePoolState.OPENED:
            raise InvalidRunspacePoolStateError(
                self.state, RunspacePoolState.OPENED,
                "disconnect a Runspace Pool"
            )

        disconnect = ET.Element("{%s}Disconnect" % NAMESPACES['rsp'])
        selector_set = SelectorSet()
        selector_set.add_option("ShellId", self.shell.id)

        self.connection.disconnect(self.shell.resource_uri, disconnect,
                                   selector_set=selector_set)
        self.state = RunspacePoolState.DISCONNECTED
        for pipeline in self.pipelines.values():
            pipeline.state = PSInvocationState.DISCONNECTED
def disconnect ( self ) : log . info ( "Disconnecting from Runspace Pool" ) if self . state == RunspacePoolState . DISCONNECTED : return elif self . state != RunspacePoolState . OPENED : raise InvalidRunspacePoolStateError ( self . state , RunspacePoolState . OPENED , "disconnect a Runspace Pool" ) disconnect = ET . Element ( "{%s}Disconnect" % NAMESPACES [ 'rsp' ] ) selector_set = SelectorSet ( ) selector_set . add_option ( "ShellId" , self . shell . id ) self . connection . disconnect ( self . shell . resource_uri , disconnect , selector_set = selector_set ) self . state = RunspacePoolState . DISCONNECTED for pipeline in self . pipelines . values ( ) : pipeline . state = PSInvocationState . DISCONNECTED