Skip to content

Conversation

@mehalter
Copy link

@mehalter mehalter commented Jul 2, 2024

Summary

These lines don't actually do anything because there is no {{workingDirectory}} set here

Implementation details

Because these lines will never evaluate to true they can just be removed

Testing

I built the image and saw in the logs {{workingDirectory}}/TOE_* not found. So there is nothing being inserted in there and the code will never resolve to anything

Description for the changelog

ENHANCEMENT - Remove unnecessary cleanup code that will never execute

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mehalter mehalter requested a review from a team as a code owner July 2, 2024 15:15
@sparrc
Copy link
Contributor

sparrc commented Jul 2, 2024

I believe the packer working directory should be /tmp, if you change this "workingDirectory" template var to /tmp do you see it finding any "TOE" files?

@mehalter
Copy link
Author

mehalter commented Jul 2, 2024

@sparrc Here is the output of /tmp:

==> amazon-ebs.al2023: ++ sudo find '/tmp/TOE_*' -type f
==> amazon-ebs.al2023: ++ sudo wc -l
==> amazon-ebs.al2023: find: ‘/tmp/TOE_*’: No such file or directory
==> amazon-ebs.al2023: + [[ 0 -gt 0 ]]
==> amazon-ebs.al2023: ++ sudo find '/tmp/TOE_*' -type f
==> amazon-ebs.al2023: ++ sudo wc -l
==> amazon-ebs.al2023: find: ‘/tmp/TOE_*’: No such file or directory
==> amazon-ebs.al2023: + [[ 0 -gt 0 ]]
==> amazon-ebs.al2023: ++ sudo find '/tmp/TOE_*' -type d
==> amazon-ebs.al2023: ++ sudo wc -l
==> amazon-ebs.al2023: find: ‘/tmp/TOE_*’: No such file or directory
==> amazon-ebs.al2023: + [[ 0 -gt 0 ]]
==> amazon-ebs.al2023: ++ sudo find '/tmp/TOE_*' -type d
==> amazon-ebs.al2023: ++ sudo wc -l
==> amazon-ebs.al2023: find: ‘/tmp/TOE_*’: No such file or directory

@mehalter
Copy link
Author

2024-07-10_15:35:56_screenshot

@sparrc I just got the image spun up and logged into it over ssh in an instance. It looks like there are no TOE_* files anywhere on the system at all. I think those files are a side effect of the image builder itself.

These lines don't actually do anything because there is no
`{{workingDirectory}}` set here
@mehalter
Copy link
Author

mehalter commented Sep 4, 2024

Any word on this @sparrc ? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants