lib/percheron/actions/shell.rb in percheron-0.7.2 vs lib/percheron/actions/shell.rb in percheron-0.7.3
- old
+ new
@@ -10,17 +10,20 @@
@container = container
@shell = shell
end
def execute!
- Validators::DockerClient.new.validate_docker_client_available!
$logger.debug "Executing #{shell} on '#{container.name}' container"
- exec!
+ exec! if valid?
end
private
attr_reader :container, :shell
+
+ def valid?
+ Validators::DockerClient.new.valid?
+ end
def exec!
system('%s exec -ti %s %s' % [ DOCKER_CLIENT, container.full_name, shell ])
end
end