lib/percheron/actions/shell.rb in percheron-0.7.6 vs lib/percheron/actions/shell.rb in percheron-0.7.7
- old
+ new
@@ -4,33 +4,33 @@
include Base
DEFAULT_COMMAND = '/bin/sh'
DOCKER_CLIENT = 'docker'
- def initialize(container, command: DEFAULT_COMMAND)
- @container = container
+ def initialize(unit, command: DEFAULT_COMMAND)
+ @unit = unit
@command = command
end
def execute!
exec! if valid?
end
private
- attr_reader :container
+ attr_reader :unit
def valid?
Validators::DockerClient.new.valid?
end
def command
"sh -c '%s'" % @command
end
def exec!
- cmd = '%s exec -ti %s %s' % [ DOCKER_CLIENT, container.full_name, command ]
- $logger.debug "Executing '#{cmd}' on '#{container.name}' container"
+ cmd = '%s exec -ti %s %s' % [ DOCKER_CLIENT, unit.full_name, command ]
+ $logger.debug %(Executing "#{cmd}" on '#{unit.name}' unit)
system(cmd)
end
end
end
end