Skip to content

Commit bea80be

Browse files
Matthew Leskogmarciani
authored andcommitted
Use start of string anchor regex for dir path ref
Previous to this commit, the pattern sent to `delete_lines` is an (interpolated) string followed by a space, such as: `/nfs `, operating on /etc/exports. Without the start of string anchor regex (`^`), the string will match a different line that shares includes the string and whitespace. Example: `/shared ` will match: `/shared ` (good) `/opt/parallelcluster/shared ` (bad!) Including a `^` forces the string to match from the beginning of the line.
1 parent 8ccd473 commit bea80be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbooks/aws-parallelcluster-config/resources/manage_ebs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
# unexport the volume
185185
delete_lines "remove volume from /etc/exports" do
186186
path "/etc/exports"
187-
pattern "#{shared_dir_array[index]} "
187+
pattern "^#{shared_dir_array[index]} "
188188
end
189189
end
190190

0 commit comments

Comments
 (0)