~raharper/curtin:fix/udevadm-info-shlex-quote

Last commit made on 2020-04-28
Get this branch:
git clone -b fix/udevadm-info-shlex-quote https://git.launchpad.net/~raharper/curtin
Only Ryan Harper can upload to this branch. If you are Ryan Harper please log in for upload directions.

Branch merges

Branch information

Name:
fix/udevadm-info-shlex-quote
Repository:
lp:~raharper/curtin

Recent commits

5ceb185... by Ryan Harper on 2020-04-28

Rework unittest and document expected result, being careful with quoting

cf07a93... by Ryan Harper on 2020-04-28

Rework ValueError, update comment, conslidate trimmed value use

a9c7968... by Ryan Harper on 2020-04-28

Use pipes.quote for py27

45c546d... by Ryan Harper on 2020-04-27

Use exception handler to trigger shlex_quote

We want to avoid using shlex_quote unless we have as we don't
actually use the quoted value in our code, applying it to all of
the values breaks our parsing of the udevadm info content. Instead
if we encounter a ValueError while invoking shlex.split() then we
first use shlex_quote() and try parsing again, and finally we try
replacing shell quote values with '_'. We log warning whenever we
have to quote or replace values.

- Add unittest with original info dump from bug submitters system

9e9f335... by Ryan Harper on 2020-04-27

Don't shlex_quote twice

17f4753... by Ryan Harper on 2020-04-27

udev: use shlex.quote before shlex.split to preserve shell escape chars

The udev database includes shell escape characters in the output.
Use shlex.quote on the values before calling shlex.split to preserve
the original characture in the value.

- Python2.7 shlex does not implement quote, use a best approximation

LP: #1875085

ec598b0... by Ryan Harper on 2020-04-22

multipath: attempt to enforce /dev/mapper/mpath files are symlinks

Multipath device scanning and bring up variablity may result in
the creation of /dev/mapper/mpath* files that are block devices
instead of a symlink to the device mapper device (/dev/dm-0).

When these block files are present, this breaks assumptions in
curtin used to look up details in sysfs for a mapper device.

d39b9af... by Ryan Harper on 2020-04-22

block-meta: device mapper partitions may be block devices not links

In some cases the multipath library may create a block device which
is not a symbolic link to the device-mapper dev[1]. Curtin expects the
symlink. Remove the non-symlink file and allow kpartx to create it.

1. https://bugzilla.redhat.com/show_bug.cgi?id=869253

2f22690... by Ɓukasz Zemczak on 2020-04-22

Default to dm_name being id if empty earlier in dm_crypt_handler()

In other parts of the code, when deciding the path for dmcrypt_dev,
we default to 'id' when 'dm_name' is not defined. We ideally want
that to happen in all the cases. The defaulting has been there
already but a bit too late.

LP: #1874243

bcf890b... by Chad Smith on 2020-04-22

storage: correct declared schema draft version for storage schema

python3-jsonschema 3.2 (Ubuntu Focal) pays attention to the $schema
version declared in the provided schema when choosing validators.

Curtin now sets that appropriate schema draft version as 4 instead of
7 to give us better schema errors.