Setting variables in __init__

Prompted by pylint W0201 (attribute-defined-outside-init) warning.

Signed-off-by: mulhern <amulhern@redhat.com>
Import name 'deviceaction' where needed

Signed-off-by: mulhern <amulhern@redhat.com>
Remove addKeyFromFile() method

Prompted by a pylint E1123 (unexpected-keyword-arg) message, but this method
seems both unused and broken.

Signed-off-by: mulhern <amulhern@redhat.com>
Remove suite() methods in tests

They don't seem to be run at all, or some would fail with a NameError.
It is not at all clear what purpose they serve.

Signed-off-by: mulhern <amulhern@redhat.com>
Do not evaluate % operator in log message arguments

Signed-off-by: mulhern <amulhern@redhat.com>
Make signature of Size.__str__ match signature of Decimal.__str__

Signed-off-by: mulhern <amulhern@redhat.com>
Suppress W0201 errors

The message for W0201 is
"Attribute '<attribute>' defined outside __init__".

In these cases, the attributes are certainly defined during
execution of __init__, but through calls to other methods, i.e., not
directly in __init__.

Not putting this in false positives because I doubt that pylint will be able
to develop the necessary call graphs to do the analysis.

Signed-off-by: mulhern <amulhern@redhat.com>
Add to false positives an error which is not suppressed by a pragma.

Pylint does not respect the pragma in this one spot.
Leaving the pragma in, in hopes that pylint will eventually respect it.
The reason it does not respect the pragma at this line, but does respect it
elsewhere is not at all clear.

Signed-off-by: mulhern <amulhern@redhat.com>
Suppress W0201 error where attribute is set in __new__.

See commit 94785c33564f7999172539b87f01a2e87baad926 for an explanation of
the reason for setting id in __new__.

Signed-off-by: mulhern <amulhern@redhat.com>
Do not cache the DeviceFormat object

Just use it to get the minSize.

Prompted by a W0201 (attribute-defined-outside-init) warning.

Signed-off-by: mulhern <amulhern@redhat.com>
Disable E1003 warning.

This warning is triggered if the first argument to super is anything other than
the name of the class. It is intentionally different in this case in order to
skip the immediate super class.

Signed-off-by: mulhern <amulhern@redhat.com>
Remove BootLoaderError definitions

Blivet does not use it anywhere.

Signed-off-by: mulhern <amulhern@redhat.com>
Suppress W0602 false positives

These are all definitely assigned to via the corresponding import statements.

Signed-off-by: mulhern <amulhern@redhat.com>
Add a stub function for get_bootloader

Prompted by a E0602 (undefined-variable) warning.

Signed-off-by: mulhern <amulhern@redhat.com>
Suppress W0621 warnings

Redefining these from the outer scope is exactly the intention.

Signed-off-by: mulhern <amulhern@redhat.com>
Suppress W0612 (unused-variable) false positives

These are all used, somehow the fact that the names are imported instead of
assigned to confuses the analysis.

Signed-off-by: mulhern <amulhern@redhat.com>
Use isResize in isShrink and isGrow.

Similar to resizeString

Signed-off-by: mulhern <amulhern@redhat.com>
Disable E1101 (no-member) error

If isResize is True, then self is an instance of ActionResizeDevice or
ActionResizeFormat and does have a member 'dir' (short for direction).

Signed-off-by: mulhern <amulhern@redhat.com>
Do not use strip() incorrectly

split() is correct and will handle possible trailing whitespace better than
a slice.

Signed-off-by: mulhern <amulhern@redhat.com>
Put module level code in a method

To avoid having unnecessary global variables.

Signed-off-by: mulhern <amulhern@redhat.com>