Skip to content

Commit

Permalink
#2226 fixed execution host
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilshat Aliev committed Feb 6, 2018
1 parent d89ba9a commit c58c9de
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.subutai.common.environment.EnvironmentDto;
import io.subutai.common.peer.ContainerHost;
import io.subutai.common.peer.LocalPeer;
import io.subutai.common.peer.ResourceHost;
import io.subutai.common.settings.Common;
import io.subutai.common.util.TaskUtil;
import io.subutai.core.environment.impl.EnvironmentManagerImpl;
Expand Down Expand Up @@ -65,13 +66,15 @@ private void checkDiskUsage( ContainerDto containerDto )
// b.b if du is >= 150 % of quota -> stop container, notify Hub
try
{
ResourceHost resourceHost = localPeer.getResourceHostById( containerDto.getRhId() );

ContainerHost containerHost = localPeer.getContainerHostById( containerDto.getId() );

CommandResult result = commandUtil
.execute( new RequestBuilder( "subutai info du " + containerDto.getContainerName() ),
containerHost );
resourceHost );

long diskUsed = Long.parseLong( result.getStdOut() );
long diskUsed = Long.parseLong( result.getStdOut().trim() );

long diskLimit = containerHost.getContainerSize().getDiskQuota().longValue();

Expand All @@ -92,7 +95,8 @@ private void checkDiskUsage( ContainerDto containerDto )
}
catch ( Exception e )
{
LOG.error( "Error checking disk usage of container " + containerDto.getContainerName(), e.getMessage() );
LOG.error( "Error checking disk usage of container {}: {}", containerDto.getContainerName(),
e.getMessage() );
}
}
}

0 comments on commit c58c9de

Please sign in to comment.