Skip to content

Commit

Permalink
Patch for use of jinja templating to refactor cloudwatch config
Browse files Browse the repository at this point in the history
  • Loading branch information
hgreebe committed Nov 15, 2023
1 parent 5819194 commit bf3a2a7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _read_json_at(path):


def _read_jinja_template_at(path):
"""Read the JSON file at path."""
"""Read the JSON file at path as a Jinja template."""
try:
with open(render_jinja_template(path), encoding="utf-8") as input_file:
return json.load(input_file)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def add_instance_log_stream_prefixes(configs):


def read_data(config_path):
"""Read in log configuration data from config_path."""
"""Read in and render jinja template of the log configuration data from config_path."""
with open(render_jinja_template(config_path), encoding="utf-8") as infile:
return json.load(infile)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def package_path
path common_module_path
user 'root'
group 'root'
mode '0644'
mode '0755'
end

execute "cloudwatch-config-validation" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

describe file('/usr/local/bin/write_cloudwatch_agent_json.py') do
it { should exist }
its('sha256sum') { should eq 'e528db6e875ed28e1ed0caf5e2e4cb9542e744ce9ebfadafa594272542fe7ea2' }
its('sha256sum') { should eq '54239b52d8cbae4b9da0efb3a73f06160e30b3580d9eba8e970fe2b81b973737' }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('mode') { should cmp '0755' }
Expand All @@ -64,7 +64,7 @@

describe file('/usr/local/bin/cloudwatch_agent_config_util.py') do
it { should exist }
its('sha256sum') { should eq '55125b14b8b5dba4b694b07f2ece008a6607ceb24ce0ae784a92affe34bd78bd' }
its('sha256sum') { should eq 'd50da5d7f6bdda90b41e18f713432c6eff8e03c6efe32f024b1c214cd9bb3eb8' }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('mode') { should cmp '0644' }
Expand All @@ -75,7 +75,7 @@
its('sha256sum') { should eq 'b65d53caf3d69f723324c4339f44cd8662a5c63ad8796118640738d7f6a63381' }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('mode') { should cmp '0644' }
its('mode') { should cmp '0755' }
end

describe 'Check the cloudwatch service'
Expand Down

0 comments on commit bf3a2a7

Please sign in to comment.