class CumulusLacpGroupHelper {

    public boolean deleteSwitchPortFromLacpGroup( SwitchNode switchNode, String lacpGroupName, String port )
        throws HmsOobNetworkException
    {
        SwitchLacpGroup lag = null;

        try
        {
            lag = getSwitchLacpGroup( switchNode, lacpGroupName );
        }
        catch ( HmsObjectNotFoundException e )
        {
            return true; // we already in desired state
        }
        catch ( HmsException e )
        {
            throw new HmsOobNetworkException( e.getMessage(), e, HmsOobNetworkErrorCode.GET_OPERATION_FAILED );
        }

        if ( lag == null )
        {
            throw new HmsOobNetworkException( "LACP group " + lacpGroupName + " could not be found.", null,
                                              HmsOobNetworkErrorCode.GET_OPERATION_FAILED );
        }

        logger.info( "Deleting LACP group " + lacpGroupName + " on switch " + switchNode.getSwitchId() );

        CumulusTorSwitchSession session = (CumulusTorSwitchSession) CumulusUtil.getSession( switchNode );
        Configuration configuration = null;

        try
        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            session.download( baos, CumulusConstants.INTERFACES_FILE );
            configuration = Configuration.parse( new ByteArrayInputStream( baos.toByteArray() ) );
        }
        catch ( Exception e )
        {
            logger.error( "Exception received while reading or parsing interfaces file", e );
            throw new HmsOobNetworkException( "Exception received while reading or parsing interfaces file", e,
                                              HmsOobNetworkErrorCode.DOWNLOAD_FAILED );
        }

        /* Delete the mentioned port its parent LACP bond. */
        deleteSwitchPortFromLacpGroup( lag, Arrays.asList( port ), configuration );

        /* Reload interfaces */
        SshExecResult result;
        try
        {
            /* Upload the file */
            ByteArrayInputStream bais = new ByteArrayInputStream( configuration.getString().getBytes() );
            CumulusUtil.uploadAsRoot( switchNode, bais, CumulusConstants.INTERFACES_FILE );
            CumulusUtil.configurePersistenceDirectory( switchNode );

            result =
                session.executeEnhanced( CumulusConstants.RELOAD_INTERFACES.replaceAll( "\\{password\\}",
                                                                                        CumulusUtil.qr( switchNode.getPassword() ) ) );

            result.logIfError( logger );
        }
        catch ( HmsException e )
        {
            throw new HmsOobNetworkException( e.getMessage(), e, HmsOobNetworkErrorCode.UPLOAD_FAILED );
        }

        return true;
    }

    public  CumulusLacpGroupHelper( CumulusTorSwitchService service );

}