Skip to content

Commit 3e7886a

Browse files
author
Himani Anil Deshpande
committed
Cookstyle corrections
1 parent 1e21e62 commit 3e7886a

File tree

4 files changed

+44
-45
lines changed

4 files changed

+44
-45
lines changed

cookbooks/aws-parallelcluster-environment/spec/unit/recipes/config_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
aws-parallelcluster-environment::raid
2828
aws-parallelcluster-environment::efs
2929
aws-parallelcluster-environment::fsx
30-
aws-parallelcluster-environment::config_cfn_hup
3130
)
3231
@expected_recipes.each do |recipe_name|
3332
allow_any_instance_of(Chef::Recipe).to receive(:include_recipe).with(recipe_name) do

cookbooks/aws-parallelcluster-environment/spec/unit/resources/cfn_hup_configuration_spec.rb

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def self.configure(chef_run)
1818
LAUNCH_TEMPLATE_ID = "LAUNCH_TEMPLATE_ID".freeze
1919
SCRIPT_DIR = "SCRIPT_DIR".freeze
2020
MONITOR_SHARED_DIR = "MONITOR_SHARED_DIR".freeze
21-
NODE_BOOTSTRAP_TIMEOUT = "1800"
21+
NODE_BOOTSTRAP_TIMEOUT = "1800".freeze
2222

2323
describe 'cfn_hup_configuration:configure' do
2424
for_all_oses do |platform, version|
@@ -29,8 +29,8 @@ def self.configure(chef_run)
2929
runner = runner(platform: platform, version: version, step_into: ['cfn_hup_configuration']) do |node|
3030
allow_any_instance_of(Object).to receive(:get_metadata_token).and_return("IMDS_TOKEN")
3131
allow_any_instance_of(Object).to receive(:get_metadata_with_token)
32-
.with("IMDS_TOKEN", URI("http://169.254.169.254/latest/meta-data/iam/security-credentials"))
33-
.and_return(INSTANCE_ROLE_NAME)
32+
.with("IMDS_TOKEN", URI("http://169.254.169.254/latest/meta-data/iam/security-credentials"))
33+
.and_return(INSTANCE_ROLE_NAME)
3434
node.override["cluster"]["node_type"] = node_type
3535
node.override["cluster"]["region"] = AWS_REGION
3636
node.override["cluster"]["aws_domain"] = AWS_DOMAIN
@@ -49,63 +49,63 @@ def self.configure(chef_run)
4949
%w(/etc/cfn /etc/cfn/hooks.d).each do |dir|
5050
it "creates the directory #{dir}" do
5151
is_expected.to create_directory(dir)
52-
.with(owner: 'root')
53-
.with(group: 'root')
54-
.with(mode: "0700")
55-
.with(recursive: true)
52+
.with(owner: 'root')
53+
.with(group: 'root')
54+
.with(mode: "0700")
55+
.with(recursive: true)
5656
end
5757
end
5858

5959
it "creates the file /etc/cfn/cfn-hup.conf" do
6060
is_expected.to create_template("/etc/cfn/cfn-hup.conf")
61-
.with(source: 'cfn_hup_configuration/cfn-hup.conf.erb')
62-
.with(user: "root")
63-
.with(group: "root")
64-
.with(mode: "0400")
65-
.with(variables: {
66-
stack_id: STACK_ID,
67-
region: AWS_REGION,
68-
cloudformation_url: CLOUDFORMATION_URL,
69-
cfn_init_role: INSTANCE_ROLE_NAME,
70-
})
61+
.with(source: 'cfn_hup_configuration/cfn-hup.conf.erb')
62+
.with(user: "root")
63+
.with(group: "root")
64+
.with(mode: "0400")
65+
.with(variables: {
66+
stack_id: STACK_ID,
67+
region: AWS_REGION,
68+
cloudformation_url: CLOUDFORMATION_URL,
69+
cfn_init_role: INSTANCE_ROLE_NAME,
70+
})
7171
end
7272

7373
it "creates the file /etc/cfn/hooks.d/pcluster-update.conf" do
7474
is_expected.to create_template("/etc/cfn/hooks.d/pcluster-update.conf")
75-
.with(source: 'cfn_hup_configuration/cfn-hook-update.conf.erb')
76-
.with(user: "root")
77-
.with(group: "root")
78-
.with(mode: "0400")
79-
.with(variables: {
80-
stack_id: STACK_ID,
81-
region: AWS_REGION,
82-
cloudformation_url: CLOUDFORMATION_URL,
83-
cfn_init_role: INSTANCE_ROLE_NAME,
84-
launch_template_resource_id: LAUNCH_TEMPLATE_ID,
85-
update_hook_script_dir: SCRIPT_DIR,
86-
node_bootstrap_timeout: NODE_BOOTSTRAP_TIMEOUT,
87-
})
75+
.with(source: 'cfn_hup_configuration/cfn-hook-update.conf.erb')
76+
.with(user: "root")
77+
.with(group: "root")
78+
.with(mode: "0400")
79+
.with(variables: {
80+
stack_id: STACK_ID,
81+
region: AWS_REGION,
82+
cloudformation_url: CLOUDFORMATION_URL,
83+
cfn_init_role: INSTANCE_ROLE_NAME,
84+
launch_template_resource_id: LAUNCH_TEMPLATE_ID,
85+
update_hook_script_dir: SCRIPT_DIR,
86+
node_bootstrap_timeout: NODE_BOOTSTRAP_TIMEOUT,
87+
})
8888
end
8989

9090
if %(ComputeFleet).include?(node_type)
9191
it "creates the file #{SCRIPT_DIR}/cfn-hup-update-action.sh" do
9292
is_expected.to create_template("#{SCRIPT_DIR}/cfn-hup-update-action.sh")
93-
.with(source: "cfn_hup_configuration/#{node_type}/cfn-hup-update-action.sh.erb")
94-
.with(user: "root")
95-
.with(group: "root")
96-
.with(mode: "0700")
97-
.with(variables: {
98-
monitor_shared_dir: "#{MONITOR_SHARED_DIR}/dna",
99-
launch_template_resource_id: LAUNCH_TEMPLATE_ID,
93+
.with(source: "cfn_hup_configuration/#{node_type}/cfn-hup-update-action.sh.erb")
94+
.with(user: "root")
95+
.with(group: "root")
96+
.with(mode: "0700")
97+
.with(variables: {
98+
monitor_shared_dir: "#{MONITOR_SHARED_DIR}/dna",
99+
launch_template_resource_id: LAUNCH_TEMPLATE_ID,
100100
})
101101
end
102102
elsif node_type == 'HeadNode'
103103
it "creates #{SCRIPT_DIR}/share_compute_fleet_dna.py" do
104104
is_expected.to create_if_missing_cookbook_file("#{SCRIPT_DIR}/share_compute_fleet_dna.py")
105-
.with(source: 'cfn_hup_configuration/share_compute_fleet_dna.py')
106-
.with(user: 'root')
107-
.with(group: 'root')
108-
.with(mode: '0700')
105+
.with(source: 'cfn_hup_configuration/share_compute_fleet_dna.py')
106+
.with(user: 'root')
107+
.with(group: 'root')
108+
.with(mode: '0700')
109109
end
110110

111111
it "creates the directory #{MONITOR_SHARED_DIR}/dna" do

cookbooks/aws-parallelcluster-platform/spec/unit/resources/fetch_dna_files_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def self.cleanup(chef_run)
3535
node.override['cluster']['region'] = region
3636
node.override['kitchen'] = true
3737
end
38-
ConvergeFetchDnaFiles.share(runner, extra_chef_attribute_location: "#{kitchen_instance_types_data_path}")
38+
ConvergeFetchDnaFiles.share(runner, extra_chef_attribute_location: "#{kitchen_instance_types_data_path}")
3939
end
4040
cached(:node) { chef_run.node }
4141

@@ -46,7 +46,7 @@ def self.cleanup(chef_run)
4646
# end
4747

4848
it 'runs share_compute_fleet_dna.py to get dna files' do
49-
is_expected.to run_execute('Share dna.json with ComputeFleet').with(
49+
is_expected.to run_execute('Run share_compute_fleet_dna.py to get user_data.sh and share dna.json with ComputeFleet').with(
5050
command: "#{cookbook_virtualenv_path}/bin/python #{node['cluster']['scripts_dir']}/share_compute_fleet_dna.py" \
5151
" --region #{node['cluster']['region']}"
5252
)

cookbooks/aws-parallelcluster-slurm/recipes/update/update_head_node.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,4 @@ def update_nodes_in_queue(strategy, queues)
284284

285285
fetch_dna_files 'Cleanup' do
286286
action :cleanup
287-
end
287+
end

0 commit comments

Comments
 (0)