Puppet: System Administration Automated

Support

Ticket #1100: updated-patch

File updated-patch, 4.8 kB (added by alden, 9 months ago)

I've updated the patch against the latest git pull (which means I've removed my patches for #1101 and #1103).

Line 
1 *** lib/puppet/defaults.rb.orig 2008-02-25 08:18:24.000000000 -0500
2 --- lib/puppet/defaults.rb      2008-02-28 16:13:00.000000000 -0500
3 ***************
4 *** 397,402 ****
5 --- 397,404 ----
6           :ignoreschedules => [false,
7               "Boolean; whether puppetd should ignore schedules.  This is useful
8               for initial puppetd runs."],
9 +         :ignoresplay => [false,
10 +             "Boolean; whether puppetd shouldn't splay when triggered by puppetrun"],
11           :puppetport => [8139, "Which port puppetd listens on."],
12           :noop => [false, "Whether puppetd should be run in noop mode."],
13           :runinterval => [1800, # 30 minutes
14 *** lib/puppet/network/client/master.rb.orig    2008-02-25 08:18:24.000000000 -0500
15 --- lib/puppet/network/client/master.rb 2008-02-28 16:13:00.000000000 -0500
16 ***************
17 *** 538,544 ****
18  
19       # Sleep when splay is enabled; else just return.
20       def splay
21 !         return unless Puppet[:splay]
22  
23           limit = Integer(Puppet[:splaylimit])
24  
25 --- 538,546 ----
26  
27       # Sleep when splay is enabled; else just return.
28       def splay
29 !         return if Puppet::Util::Storage.cache(:configuration)[:prignoresplay] or
30 !                   not Puppet[:splay] or
31 !                   ( Puppet[:ignoresplay] and Puppet::Util::Storage.cache(:configuration)[:prtrigger] )
32  
33           limit = Integer(Puppet[:splaylimit])
34  
35 *** lib/puppet/network/handler/runner.rb.orig   2008-02-25 08:18:12.000000000 -0500
36 --- lib/puppet/network/handler/runner.rb        2008-02-28 16:13:00.000000000 -0500
37 ***************
38 *** 12,18 ****
39  
40           # Run the client configuration right now, optionally specifying
41           # tags and whether to ignore schedules
42 !         def run(tags = nil, ignoreschedules = false, fg = true, client = nil, clientip = nil)
43               # We need to retrieve the client
44               master = Puppet::Network::Client.client(:Master).instance
45  
46 --- 12,18 ----
47  
48           # Run the client configuration right now, optionally specifying
49           # tags and whether to ignore schedules
50 !         def run(tags = nil, ignoreschedules = false, ignoresplay = false, fg = true, client = nil, clientip = nil)
51               # We need to retrieve the client
52               master = Puppet::Network::Client.client(:Master).instance
53  
54 ***************
55 *** 33,38 ****
56 --- 33,42 ----
57                   ignoreschedules == nil
58               end
59  
60 +             if ignoresplay == ""
61 +                 ignoresplay == nil
62 +             end
63 +
64               msg = ""
65               if client
66                   msg = "%s(%s) " % [client, clientip]
67 ***************
68 *** 46,51 ****
69 --- 50,62 ----
70                   msg += " ignoring schedules"
71               end
72  
73 +             if ignoresplay
74 +                 msg += " not splaying"
75 +                 Puppet::Util::Storage.cache(:configuration)[:prignoresplay] = 1
76 +             end
77 +
78 +             Puppet::Util::Storage.cache(:configuration)[:prtrigger] = true
79 +
80               Puppet.notice msg
81  
82               # And then we need to tell it to run, with this extra info.
83 *** bin/puppetrun.orig  2008-02-28 16:12:29.000000000 -0500
84 --- bin/puppetrun       2008-02-28 16:13:00.000000000 -0500
85 ***************
86 *** 8,14 ****
87   # = Usage
88   #
89   #   puppetrun [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground]
90 ! #       [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules]
91   #       [-t|--tag <tag>] [--test]
92   #
93   # = Description
94 --- 8,14 ----
95   # = Usage
96   #
97   #   puppetrun [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground]
98 ! #       [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules] [--ignoresplay]
99   #       [-t|--tag <tag>] [--test]
100   #
101   # = Description
102 ***************
103 *** 205,210 ****
104 --- 205,211 ----
105  
106   options = {
107       :ignoreschedules => false,
108 +     :ignoresplay => false,
109       :foreground => false,
110       :parallel => 1,
111       :debug => false,
112 ***************
113 *** 228,233 ****
114 --- 229,236 ----
115                   exit
116               when "--ignoreschedules"
117                   options[:ignoreschedules] = true
118 +             when "--ignoresplay"
119 +                 options[:ignoresplay] = true
120               when "--no-fqdn"
121                   options[:fqdn] = false
122               when "--all"
123 ***************
124 *** 346,352 ****
125  
126               print "Triggering %s\n" % host
127               begin
128 !                 result = client.run(tags, options[:ignoreschedules], options[:foreground])
129               rescue => detail
130                   $stderr.puts "Host %s failed: %s\n" % [host, detail]
131                   exit(2)
132 --- 349,355 ----
133  
134               print "Triggering %s\n" % host
135               begin
136 !                 result = client.run(tags, options[:ignoreschedules], options[:ignoresplay], options[:foreground])
137               rescue => detail
138                   $stderr.puts "Host %s failed: %s\n" % [host, detail]
139                   exit(2)