-
Notifications
You must be signed in to change notification settings - Fork 41
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
Imprv/389 #413
base: release/1.9.3
Are you sure you want to change the base?
Imprv/389 #413
Conversation
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.
reviewed
- Absolute file path to the script. | ||
type: path | ||
required: true | ||
suboptions: |
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.
suboptions
is already defined above.
@@ -355,14 +355,17 @@ def _build_spec_boot_config(self, payload, param): | |||
return payload, None | |||
|
|||
def _build_spec_gc(self, payload, param): | |||
fpath = param["script_path"] | |||
if param["script_path"]: |
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.
what if script path is not given?
if param["script_path"]: | |
if param.get("script_path"): |
with open(fpath, "rb") as f: | ||
content = base64.b64encode(f.read()) | ||
else: | ||
content = base64.b64encode(param["script"]) |
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.
param of b64encode
function should be a bytes-like object
content = base64.b64encode(param["script"]) | |
content = base64.b64encode(param["script"].encode('ascii')) |
@grdavies Please add tests for your change. @alaa-bish can guide you here. |
@grdavies Can you please look into the PR comments in order to make it to release. |
Added ability to provide sysprep/cloud-init via variable instead of just an input script