promotion 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
== Version 1.3.
|
1
|
+
== Version 1.3.5
|
2
2
|
- Schedule in newsyslog handles $-formats (starting with 'D', 'W', or 'M')
|
3
3
|
and @-formats (containing 'T') as well as integer hours and '*'
|
4
|
+
- More space for newsyslog columns
|
4
5
|
|
5
6
|
== Version 1.3.2
|
6
7
|
- Fixed defect in crontab where comments were not prefixed with #
|
@@ -5,14 +5,14 @@ module Newsyslog
|
|
5
5
|
# Writes the Newsyslog configuration
|
6
6
|
def self.generate(specs)
|
7
7
|
sym = "Newsyslog"
|
8
|
-
|
9
|
-
|
10
|
-
newContents = originalContents + Marker + contents(specs)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
begin
|
9
|
+
originalContents = Promotion::Generator::original_contents_for(sym)
|
10
|
+
newContents = originalContents + Marker + "\n" + contents(specs)
|
11
|
+
Promotion::Generator::write_file_for(sym, newContents)
|
12
|
+
rescue => e
|
13
|
+
$log.error("Error occurred while generating #{sym}\n#{e.message}" + e.backtrace.join("\n"))
|
14
|
+
exit 1
|
15
|
+
end
|
16
16
|
end
|
17
17
|
|
18
18
|
# Generates the contents for /etc/newsyslog.conf, which controls rolling and retention of logs
|
@@ -22,7 +22,7 @@ module Newsyslog
|
|
22
22
|
contents << "# It was generated by the promotion application and will be overwritten\n"
|
23
23
|
contents << "# when the next promotion occurs.\n"
|
24
24
|
contents << "# The previous section will be preserved\n\n"
|
25
|
-
contents << "# Filename
|
25
|
+
contents << "# Filename Owner:Group Mode Count Size When Flags\n"
|
26
26
|
specs.each { |spec|
|
27
27
|
spec.elements.each("/Specification/Newsyslog") { |nsl|
|
28
28
|
contents << "%-40s" % nsl.text()
|
@@ -38,7 +38,7 @@ module Newsyslog
|
|
38
38
|
contents << "%-7s" % (nsl.attributes["Count"] || "*")
|
39
39
|
contents << "%-7s" % (nsl.attributes["Size"] || "*")
|
40
40
|
# treat as $-format if starts with D,W,M; treat as integer if integer
|
41
|
-
|
41
|
+
# else treat as @-format if digits with a 'T'
|
42
42
|
sched = nsl.attributes["When"] || "*"
|
43
43
|
if sched[0..0] == "D" or sched[0..0] == "W" or sched[0..0] == "M"
|
44
44
|
contents << "$%-9s" % sched
|
@@ -7,7 +7,7 @@ module Profile
|
|
7
7
|
sym = "Profile"
|
8
8
|
begin
|
9
9
|
originalContents = Promotion::Generator::original_contents_for(sym)
|
10
|
-
newContents = originalContents + Marker + contents(specs)
|
10
|
+
newContents = originalContents + Marker + "\n" + contents(specs)
|
11
11
|
Promotion::Generator::write_file_for(sym, newContents)
|
12
12
|
rescue => e
|
13
13
|
$log.error("Error occurred while generating #{sym}\n#{e.message}" + e.backtrace.join("\n"))
|
@@ -7,7 +7,7 @@ module Rcconf
|
|
7
7
|
sym = "Rc_conf"
|
8
8
|
begin
|
9
9
|
originalContents = Promotion::Generator::original_contents_for(sym)
|
10
|
-
newContents = originalContents + Marker + contents(specs)
|
10
|
+
newContents = originalContents + Marker + "\n" + contents(specs)
|
11
11
|
Promotion::Generator::write_file_for(sym, newContents)
|
12
12
|
rescue => e
|
13
13
|
$log.error("Error occurred while generating #{sym}\n#{e.message}" + e.backtrace.join("\n"))
|
@@ -7,7 +7,7 @@ module Sudoers
|
|
7
7
|
sym = "Sudoers"
|
8
8
|
begin
|
9
9
|
originalContents = Promotion::Generator::original_contents_for(sym)
|
10
|
-
newContents = originalContents + Marker + contents(specs)
|
10
|
+
newContents = originalContents + Marker + "\n" + contents(specs)
|
11
11
|
tempFilename = Promotion::Generator::write_file_for(sym, newContents, true)
|
12
12
|
$log.info("Checking temporary sudoers written to #{tempFilename}.")
|
13
13
|
visudoResults = `#{Files::Visudo} -c -f #{tempFilename}`
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 5
|
10
|
+
version: 1.3.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Richard Kernahan
|