History | View | Annotate | Download (28.6 kB)
Replace frozenset with compat.UniqueFrozenset
This is not a trivial s/frozenset/compat.UniqueFrozenset/, but ratheronly replaces “frozenset” where appropriate. Most of the places are“static” information that doesn't change after the module has beenloaded....
Fixes to pass pep8 (make lint)
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Iustin Pop <iustin@google.com>
Bump pep8 version to 1.2
Debian Wheezy will ship with this version, and it has many improved checks compared to 0.6, so let's:
- bump version in the docs- silence some new checks that are wrong due to our indent=2 instead of 4- fix lots of errors in the code where the indentation was wrong by 1...
Fix epydoc raises L{...} usage
For epydoc raise statement, it already expects an exception which willbe hyperlinked; if passing an L{…} construct, it will instead breakthe formatting (the @raise will not be recognised, but merged into theprevious paragraph)....
Enable lvmstrap to run under Linux 3.x
Extend the kernel version check to also accept Linux 3.x as valid.
Signed-off-by: Alexander Schreiber <als@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Replace single- with double-quotes
In at least two cases "%s" is replaced with str(), too.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
PEP8 style fixes
Identified using the “pep8” utility.
Add support for GPT by using parted for disks bigger than 2TB.
Signed-off-by: Pedro Macedo <pmacedo@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
lvmstrap: fix logic bug for partition reread
The if structure in CheckReread is broken, and makes partitions rereadbe full of race issues (esp. after updating them).
Also fix a small message bug.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
lvmstrap: fix very old contact information
A memory from the past: this was left over from before the 1.2 releaseor so…
lvmstrap: add more excluded FS types
Also moves the list of excluded types to the top level and make it afrozenset.
lvmstrap: add an explicit test for mounted devices
Recent kernels/userland report a mounted filesystem as follows:
root@node4:~# fuser -avm /dev/sda5 USER PID ACCESS COMMAND /dev/sda5: root kernel mount /srv/ganeti...
lvmstrap: add explicit test for swap backends
Similar to mounted filesystems, recent kernel/userland report swapbackends:
root@node4:~# fuser -avm /dev/sda6 USER PID ACCESS COMMAND /dev/sda6: root kernel swap /dev/sda6...
lvmstrap: ignore small-sized partitions
This patch changes lvmstrap to ignore “small” partitions. Currentlyextended partitions are reported as unused as with a size of 1024(bytes), and this confuses lvmstrap. Since a very small partitionwon't help anyway (below hundred of PE size is not helpful), let's...
lvmstrap: abstract a little the sysfs paths
lvmstrap: add PV-on-partition support
This is a not-so-nice change, adding support for partitions to be usedas PVs.
The not-nice part is that partitions live in a separate place insysfs, whereas in dev they live at the same level as disks. Weworkaround this via a new SysfsName function that computes the correct...
lvmstrap: also test sysfs holders
If a device has entries in its holder directory(/sys/block/$name/holders), it means that some kernel system "uses" that device, and hence should not be considered available.
This patch adds a new 'in-use' check based on this sysfs test, and...
lvmstrap: add support for non-partitioned md disks
This patch, originally written by Marc Schmitt <mschmitt@google.com>,adds support for MD devices (used in a non-partitioned mode). Iabstracted all the original startswith('md') checks into separatefunctions, and also moved the supported disk types to a list....
Update docstrings in tools/ and enable epydoc
This patch updates the docstrings in tools/ (mostly in lvmstrap, whichis very very old code-base) and then enabled the tools in this directoryfor 'make apidoc' too.
Signed-off-by: Iustin Pop <iustin@google.com>...
Remove more unused variables
This removes unused variables in the rest of the code (outside lib/).
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Add targeted pylint disables
This patch should have only:
- pylint disables- docstring changes- whitespace changes
Unify the multiple 'verbose' options
Currently multiple files define a 'verbose' option. This patch moves allthese definitions to a single VERBOSE_OPT option which is exported fromcli.py.
Merge branch 'next' into branch-2.1
lvmstrap: Change diskinfo to use GenerateTable
This way the produced table is formatted nicely.
Signed-off-by: Stephen Shirley <diamond@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix some typos
Use ReadFile.splitlines() rather than readlines
A few places in the code open a file "manually" rather than using ourwrapper function, because they need an array with the lines. Combiningthe result of utils.ReadFile with splitlines() we get rid of theexceptions....
lvmstrap: allow removable devices too
For testing or just in case a device is exported by a bad driver withthe 'removable' flag set, this patch adds a flag to lvmstrap that allowsit to use these devices too.
Reviewed-by: ultrotter
Codestyle fixes: adding a few empty lines
Various code style fixes for strings.
- When line wrapping is needed, move spaces to the next line.- Remove embedded line breaks from error messages.
Reviewed-by: schreiberal
Replace tabs with spaces.
Reviewed-by: iustinp
Initial commit.