<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 19, 2020 at 9:39 AM Dennis Kliban <<a href="mailto:dkliban@redhat.com">dkliban@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 19, 2020 at 9:22 AM Bruno Rocha <<a href="mailto:rochacbruno@redhat.com" target="_blank">rochacbruno@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>From the issue:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Writing <code>aws_default_acl: None</code> in the <code>pulp_settings</code> variable gets rendered to <code>AWS_DEFAULT_ACL = "None"</code>, not <code>AWS_DEFAULT_ACL = None</code></div></blockquote><div><code><br></code></div><div>As TOML does not allow `null` values dynaconf has a special syntax for expressing that: <a href="https://dynaconf.readthedocs.io/en/latest/guides/environment_variables.html#precedence-and-type-casting" target="_blank">https://dynaconf.readthedocs.io/en/latest/guides/environment_variables.html#precedence-and-type-casting</a></div><div><br></div><div>aws_default_acl: "@none None" might be a workaround.<br></div><br></div></blockquote><div><br></div><div><div>Thank you Bruno! Could you please comment on the issue?</div><div><br></div><div>This should resolve the issue that I linked in my original email. However,there is still a problem when the setting value is a list or a dictionary. The template needs to be much more robust to handle that. It still makes sense to switch to JSON.<br></div></div><div></div></div></div></blockquote><div><br></div><div>The other option is to make no change at all and simply add documentation that says you can provide values to ansible-pulp in the same format as you would using environment variables. In that case everything can be treated as a string and Dynaconf interprets it into Python at runtime. I am leaning toward this option. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Also there is an issue opened regarding the YAML null values: <a href="https://github.com/rochacbruno/dynaconf/issues/288" target="_blank">https://github.com/rochacbruno/dynaconf/issues/288</a><div><code></code></div><div><code><br></code></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 19, 2020 at 10:57 AM Dennis Kliban <<a href="mailto:dkliban@redhat.com" target="_blank">dkliban@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>ansible-pulp currently tries to generate a Python settings file.from settings provided by the user in the playbook[0]. However, the generated Python code is not always syntactically correct[1]. <br></div><div><br></div><div>The settings file is generated using a Jinja template. Jinja provides a to_json that can be used to generate the settings as JSON. I propose that we change the behavior of ansible-pulp to generate settings.json instead of settings.py.</div><div><br></div><div>Are there any objections or other ideas?<br></div><div><br></div><div>[0] <a href="https://github.com/pulp/ansible-pulp/blob/master/roles/pulp/templates/settings.py.j2" target="_blank">https://github.com/pulp/ansible-pulp/blob/master/roles/pulp/templates/settings.py.j2</a></div><div>[1] <a href="https://pulp.plan.io/issues/5687" target="_blank">https://pulp.plan.io/issues/5687</a></div><br></div>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div>
</blockquote></div></div>
</blockquote></div></div>