8 Commits

Author SHA1 Message Date
Zuul
1201d46ee3 Merge "YAML NIC Config 2 script - fix comment indentation" 2018-12-12 05:50:32 +00:00
zhulingjie
5edaac5246 Python 3 compatibility: convert raw_input to input
Change-Id: I86699cc6d880c137e80183d7196874ec0f7893e7
Closes-Bug: #1797760
2018-11-12 16:03:47 +00:00
Harald Jensås
0b58798c8e YAML NIC Config 2 script - fix comment indentation
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
2018-10-06 10:17:01 +00:00
Bob Fournier
f997e3da60 Handle blank lines followed by comment in nic conversion script
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
2018-06-29 08:02:12 +00:00
Marius Cornea
553554ad72 Add option to override confirmation in yaml-nic-config-2-script.py
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
2018-05-09 21:52:14 -04:00
Bob Fournier
0017b64560 Add check for old-style nic config files
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
2018-03-16 15:34:43 -04:00
loooosy
d72b0b9fac Replace six.iteritems() with .items()
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
2017-04-07 15:23:50 +08:00
Dan Prince
2985cd9a3a Apply os-net-config with a script instead of element
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
2016-11-28 14:23:11 -05:00