Bug 1043394 - listener.rb fixes
Summary: listener.rb fixes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: brice
QA Contact: ecs-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-16 08:21 UTC by Brenton Leanhardt
Modified: 2015-07-20 00:21 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-06 05:08:07 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Brenton Leanhardt 2013-12-16 08:21:45 UTC
Description of problem:

In listener.rb the following changes are needed.

--- listener.rb.orig    2013-12-16 08:19:53.182002289 -0500
+++ listener.rb 2013-12-16 01:40:21.095994919 -0500
   scope = "#{appname}-#{namespace}"
   file = File.join(CONF_DIR, "#{scope}.conf")
   if File.exist?(file)
-    `sed -i 's/upstream #{scope} {/&\n      server #{ip}:#{port}' #{file}`
+    `sed -i 's/upstream #{scope} {/&\\n      server #{ip}:#{port};/' #{file}` 
   else
     # write a new one
-    template = >>-EOF
+    template = <<-EOF
     upstream #{scope} {
       server #{ip}:#{port};
     }

Comment 2 Luke Meyer 2013-12-16 15:45:34 UTC
Context is "5.8.5.1.2. Routing Listener" under "5.8.5. External Load Balancing" http://documentation-devel.engineering.redhat.com/docs/en-US/OpenShift_Enterprise/2/html-single/Deployment_Guide/index.html#sect-External_Load_Balancing

Comment 6 Luke Meyer 2013-12-17 18:12:41 UTC
I copied the source here:

https://github.com/openshift/openshift-extras/blob/master/admin/sample_routing_listener.rb
https://github.com/openshift/openshift-extras/blob/enterprise-2.0/admin/sample_routing_listener.rb

... and applied changes. May want to point to the enterprise-2.0 version in the docs; possibly for future versions it will need non-compatible updates.

Comment 7 brice 2013-12-18 02:16:37 UTC
I believe I have made the appropriate changes. At least I hope... I went by the info in the initial comment, but it may not be exactly what you've asked for.

Let me know if any other changes need to be made.

Comment 9 Brenton Leanhardt 2013-12-18 03:14:19 UTC
(In reply to brice from comment #7)
> I believe I have made the appropriate changes. At least I hope... I went by
> the info in the initial comment, but it may not be exactly what you've asked
> for.
> 
> Let me know if any other changes need to be made.

I think the sed line is still wrong.  It needs to be:

`sed -i 's/upstream #{scope} {/&\\n      server #{ip}:#{port};/' #{file}`

I see part of it was updated but it is missing the ;/

Comment 10 brice 2013-12-18 03:19:09 UTC
You are correct. It should be alright now.

Comment 11 Brenton Leanhardt 2013-12-18 03:31:44 UTC
This line should not be there:

listener.rb 2013-12-16 01:40:21.095994919 -0500

That was the diff output.

Comment 12 Brenton Leanhardt 2013-12-18 03:35:43 UTC
Actually, while we're making changes.  Please fetch the latest from https://raw.github.com/openshift/openshift-extras/enterprise-2.0/admin/sample_routing_listener.rb

That files includes important comments the will prove helpful for the admin.

Comment 13 brice 2013-12-18 04:44:48 UTC
Line has been removed and I've talked to Brenton. Topic should be good now. Topic matches quite well with the github doc too.

Putting to QA.


Note You need to log in before you can comment on or make changes to this bug.