lib/mkit/app/model/service.rb in mkit-0.4.2 vs lib/mkit/app/model/service.rb in mkit-0.4.3

- old
+ new

@@ -129,11 +129,11 @@ self.save end end def create_pods_network - create_network(self.pods_network) if !network_exists?(self.pods_network) + create_network(self.pods_network) unless network_exists?(self.pods_network) end def deploy_network # create service interface... self.lease.confirm @@ -235,9 +235,18 @@ self.pod.each { |p| MkitJob.publish(topic: :stop_pod, service_id: self.id, pod_id: p.id) } end + def log + out = "" + self.pod.each { |p| + out << "<<<< %s | %s >>>>\n" % [self.name, p.name] + puts logs(p.name) + out << logs(p.name) + } + out + end def as_json(options = {}) srv = super a=[:pod, :volume, :service_config, :service_port] a.each { | k | srv[k] ||= []