-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unused code, fix guestinfo data paths #166
Conversation
/assign @ncdc |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking at this a little closer, I think there is a simpler way, and one that satisfies shellcheck.
-e "guestinfo.userdata='$(base64 -w0 <build/images/cloudinit/user-data)'" \ | ||
-e "guestinfo.metadata='$(base64 -w0 <build/images/cloudinit/meta-data)'" | ||
-e "guestinfo.userdata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/user-data)'" \ | ||
-e "guestinfo.metadata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/meta-data)'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tried it, but this looks weird to me. why the pwd
call? Also, it seems like a couple sets of nested double-quotes without escaping...
shellcheck also does not like this:
$ shellcheck image-govc-cloudinit.sh
In image-govc-cloudinit.sh line 72:
-e "guestinfo.userdata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/user-data)'" \
^-- SC2046: Quote this to prevent word splitting.
In image-govc-cloudinit.sh line 73:
-e "guestinfo.metadata='$(base64 -w0 <$( cd "$( dirname "$0" )" && pwd )/../cloudinit/meta-data)'"
^-- SC2046: Quote this to prevent word splitting.
I might suggest an alternative. Rather than deleting the cd "$(dirname "${BASH_SOURCE[0]}")/.."
above, keep it, and change build/images/cloudinit/...
to cloudinit/...
.
The way I see it, we've basically changed from do a cd
to the directory above us once to doing it twice. Any compelling reason to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see why the pwd
now. But still, I think there's a much simpler way. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was just more explicit in terms of reading for me, but the suggestion is fine and have pushed an update to reflect
/assign @codenrhoden |
/lgtm Thanks! It has obviously been a while someone used that script. Clearly not since the project was moved over into this repo and the directory structure changed. :) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrisjs, codenrhoden The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.