When translating comments into yaml the last_non_comment_spaces
must be set to the current spaces prior to insering the comment.
Change-Id: Ib5bbb47cfce7d6c0ac0990a3c9384f5143dd1263
Currently if a blank line is followed by a comment the 'last_non_comment_spaces'
variable gets reset, which results in the comment line not being indented.
This just ignores blank lines so that 'last_non_comment_spaces' isn't reset
and the comment line is properly indented.
Closes-Bug: 1779191
Change-Id: I286da578c42df24242ba38df12d42c8a8fdd4a4f
This change adds the option to override the user input confirmation
to overwrite the nic template file. This is required when the script
is used inside automated jobs.
Closes-bug: 1770296
Change-Id: Ic8275bb3a944e503c73ab06c3d5140ea3563c0a6
Since old-style nic config files can no longer be used in Queens
or Rocky (the format changed in Ocata), add a check in yaml-validate
to detect that old-style files are in use and list conversion script
that can be used.
Made some changes to the script to ask before overwriting the nic
config file and save a datestamped copy as backup. In addition,
the script now takes an optional parameter to define location
of run-os-net-config.sh.
Change-Id: Ic56c48fa35ab2f4c1762c0e370be03fbf2e7671c
Closes-Bug: 1753812
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable. 2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Change-Id: I7c8f540eced0731f4dfb1dfd045828b5a9bb6c67
Wire in os-net-config via a normal script heat deployment, which has the
following advantages:
1. Improved error path, currently o-a-c deployments don't report any
errors, thus hang and eventually the deployment times out
2. It's far more hackable from a deployer perspective, e.g it's
much easier to change the os-net-config options or include a
mapping file
3. Reduces our dependencies on o-a-c (it's only os-net-config and hiera
which requires it), although the script does currently still use oac to
get the metadata IP.
4. May enable passing os-net-config yaml via a json parameter in future,
reducing the need for resource_registry mappings (although we'll have to
support that for backwards compatibility)
The script used is based directly on 20-os-net-config (from t-i-e
at cf94c5e, we can probably improve this now that we have an error path,
but for this initial commit it's a straight copy other than the changes to
replace o-a-c for rendering the json config file.
Co-Authored-By: Steven Hardy <shardy@redhat.com>
Change-Id: I0ed08332cfc49a579de2e83960f0d8047690b97a