Hello again libvirt community!
This summer, I once again worked on a GSoC project with libvirt. This
time, the goal of my project was to improve the libvirt integration with
SaltStack and, in particular, the support for VM migration.
SaltStack is an incredibly valuable tool that helps with
Hello again libvirt community!
This summer, I once again worked on a GSoC project with libvirt. This
time, the goal of my project was to improve the libvirt integration with
SaltStack and, in particular, the support for VM migration.
SaltStack is an incredibly valuable tool that helps with
Hello everyone,
As a quick introduction, I’m Radostin Stoyanov, a Google Summer of Code
student from University of Cambridge.
In the next few months I’ll be working with my mentors Cédric Bosdonnat,
Pavel Hrdina and Tyler Johnson (Akmod) on the project "Take migration in
Salt virt m
Support for Python 2.X has been dropped with commit b22e4f2.
Signed-off-by: Radostin Stoyanov
---
tox.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tox.ini b/tox.ini
index e8c33f1..de683b9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py26,py27
$ grep -R LIBVIRTD_CONFIGURATION_FILE .
./docs/news-2013.html.in: Fix LIBVIRTD_CONFIGURATION_FILE constant
(Christophe Fergeau),
./src/remote/remote_daemon.c: LIBVIRTD_CONFIGURATION_FILE,
and make fails with:
CC xenconfig/libvirt_xenconfig_libxl_la-xen_sxpr.lo
Signed-off-by: Radostin Stoyanov
---
config-post.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/config-post.h b/config-post.h
index dd4ef8fc0b..54731feff7 100644
--- a/config-post.h
+++ b/config-post.h
@@ -69,7 +69,6 @@
# undef WITH_VIRTUALPORT
# undef WITH_SECDRIVER_SELINUX
# undef
Yes, I can confirm that. The following google query shows more of the
.html.in pages:
inurl:html.in site:libvirt.org
https://www.google.com/search?=inurl%3Ahtml.in+site%3Alibvirt.org
On 22/12/2018 22:13, Vasiliy Tolstov wrote:
> Hi. I found in google that for some docs it have two pages, one
/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6397fac4915ab3002dc15aae751455da1a852f25
Signed-off-by: Radostin Stoyanov
---
src/lxc/lxc_controller.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 99360397a7..2bec8846aa
ibexec/libvirt-sandbox-init-common | grep ld
/lib64/ld-linux-x86-64.so.2 (0x7f18135eb000)
Signed-off-by: Radostin Stoyanov
---
libvirt-sandbox/libvirt-sandbox-builder.c | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/libvirt-sandbox/libvirt-sandbox-builde
Radostin Stoyanov (2):
builder: Use prefix '=> /' to identify lib path
Use "/boot/vmlinuz-linux" as default kernel path
bin/virt-sandbox.c| 5 +++--
libvirt-sandbox/libvirt-sandbox-builder-machine.c | 4
libvirt-sandbox/libvirt-sand
On some linux distributions "/boot/vmlinuz-linux" is set as default
kernel path. If this file does not exist we fallback to the value
"/boot/vmlinuz-$KERNEL-VERSION"
Signed-off-by: Radostin Stoyanov
---
bin/virt-sandbox.c| 5 +++--
libvirt-san
On 13/06/18 11:46, Daniel P. Berrangé wrote:
> On Sun, Jun 10, 2018 at 12:14:22PM +0100, Radostin Stoyanov wrote:
>> Hi all,
>>
>> This patch series aims to resolve
>> https://bugzilla.redhat.com/show_bug.cgi?id=1328946
>>
>> For background information about
kes the following condition tautology:
if (root->type == VIR_DOMAIN_FS_TYPE_MOUNT)
return 0;
Signed-off-by: Radostin Stoyanov
---
src/lxc/lxc_container.c | 53 -
1 file changed, 53 deletions(-)
diff --git a/src/lxc/lxc_container.c b/s
When user-namespace is enabled we are not allowed
to mount block/NBD devices.
Instead, mount /dev/nbdX to /run/libvirt/lxc/.root
and set:
fs->src->path = /run/libvirt/lxc/.root
fs->type = VIR_DOMAIN_FS_TYPE_MOUNT
---
src/lxc/lxc_controller.c | 62
There is no functional change in this patch.
It only moves virLXCControllerAppendNBDPids above
virLXCControllerSetupNBDDeviceFS.
---
src/lxc/lxc_controller.c | 96
1 file changed, 49 insertions(+), 47 deletions(-)
diff --git a/src/lxc/lxc_controller.c
---
src/lxc/lxc_container.c | 5 +
src/lxc/lxc_container.h | 4
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 665b93a0ac..3f6be9f44d 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -113,9
do nsenter \
--mount=/proc/$CT_PID/task/$CT_PID/ns/mnt \
/bin/bash -c "umount /var/run/libvirt/lxc/guest.root/"
I noticed that we already have the functions lxcContainerUnmountSubtree
and virProcessRunInMountNamespace.
Any suggestions on how to properly implement this
On 05/06/18 07:50, Ján Tomko wrote:
> On Tue, Jun 05, 2018 at 07:32:57AM +0100, Radostin Stoyanov wrote:
>> The variable forkRest is not used after commit 25f8781
>>
>
> forkRet
>
>> https://github.com/libvirt/libvirt/commit/25f8781#diff-d2023c1
The variable forkRet is not used after commit 25f8781
Signed-off-by: Radostin Stoyanov
---
src/util/virfile.c | 10 --
1 file changed, 10 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 523241f64f..a2c4cebb56 100644
--- a/src/util/virfile.c
+++ b/src/util
The variable forkRet is not used after commit 25f8781
https://github.com/libvirt/libvirt/commit/25f8781#diff-d2023c1ac4f688aa2021e21cfb60d4f0L1861
Signed-off-by: Radostin Stoyanov
---
src/util/virfile.c | 10 --
1 file changed, 10 deletions(-)
diff --git a/src/util/virfile.c b/src
The variable forkRest is not used after commit 25f8781
https://github.com/libvirt/libvirt/commit/25f8781#diff-d2023c1ac4f688aa2021e21cfb60d4f0L1861
Signed-off-by: Radostin Stoyanov
---
src/util/virfile.c | 10 --
1 file changed, 10 deletions(-)
diff --git a/src/util/virfile.c b/src
I will resend this patch with more appropriate title.
On 05/06/18 07:32, Radostin Stoyanov wrote:
> The variable forkRest is not used after commit 25f8781
>
> https://github.com/libvirt/libvirt/commit/25f8781#diff-d2023c1ac4f688aa2021e21cfb60d4f0L1861
>
> Signed-off-by: Ra
The variable forkRest is not used after commit 25f8781
https://github.com/libvirt/libvirt/commit/25f8781#diff-d2023c1ac4f688aa2021e21cfb60d4f0L1861
Signed-off-by: Radostin Stoyanov
---
src/util/virfile.c | 10 --
1 file changed, 10 deletions(-)
diff --git a/src/util/virfile.c b/src
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
libvirt_sandbox_image/sources/docker.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/libvirt_sandbox_image/sources/docker.py
b/libvirt_sandbox_image/sources/docker.py
index 3ca1b10..8a231ee 100755
--- a/libvirt_sandbox
Pylint warning W0311 - Bad indentation
http://pylint-messages.wikidot.com/messages:w0311
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
libvirt_sandbox_image/sources/docker.py | 4 ++--
scripts/virt-sandbox-image | 2 +-
setup.py
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
libvirt_sandbox_image/cli.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libvirt_sandbox_image/cli.py b/libvirt_sandbox_image/cli.py
index 08c88a4..e96d422 100644
--- a/libvirt_sandbox_image/cli.py
+++ b/libvirt_sandbox
-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
scripts/virt-sandbox-image | 3 ++-
setup.py | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/scripts/virt-sandbox-image b/scripts/virt-sandbox-image
index 9be4f8c..9d0ff82 100755
--- a/scripts/virt-s
This patch series introduces a few small changes towards making the code of
virt-sandbox-image compatible with PEP8.
Radostin Stoyanov (9):
pylint: Remove unused import statements
pylint: Move standard library imports on top
pylint: Use consistent indentation of 4 spaces
py3: Use
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
libvirt_sandbox_image/cli.py| 3 ---
libvirt_sandbox_image/sources/docker.py | 1 -
setup.py| 3 ---
3 files changed, 7 deletions(-)
diff --git a/libvirt_sandbox_image/cl
This changes aim to resolve Pylint C0326.
http://pylint-messages.wikidot.com/messages:c0326
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
libvirt_sandbox_image/cli.py | 26 +-
libvirt_sandbox_image/sources/base.py
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
setup.py | 2 ++
1 file changed, 2 insertions(+)
mode change 100644 => 100755 setup.py
diff --git a/setup.py b/setup.py
old mode 100644
new mode 100755
index 0b16ae7..aec7f03
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,5 @@
+#
-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
libvirt_sandbox_image/cli.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/libvirt_sandbox_image/cli.py b/libvirt_sandbox_image/cli.py
index e96d422..95c5147 100644
--- a/libvirt_sandbox_image/cli.py
+++ b/libvirt_sandbox_image/cli.py
@@ -
In Python3, the __builtin__ module is renamed to builtins.
https://docs.python.org/3/library/builtins.html#module-builtins
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
libvirt_sandbox_image/cli.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff
On 16/04/18 10:33, Daniel P. Berrangé wrote:
> On Sun, Apr 15, 2018 at 04:30:11PM +0100, Radostin Stoyanov wrote:
>> Remove the /.oldroot directory after it has been unmounted (at the end
>> of lxcContainerSetupPivotRoot). Ignore errors silently.
>>
>> Signed-off-by:
When user-namespace is enabled we are not allowed
to mount block/NBD devices.
Instead, mount /dev/nbdX to /run/libvirt/lxc/.root
and set:
fs->src->path = /run/libvirt/lxc/.root
fs->type = VIR_DOMAIN_FS_TYPE_MOUNT
---
src/lxc/lxc_container.c | 53
There is no functional change in this patch.
It only moves virLXCControllerAppendNBDPids above
virLXCControllerSetupNBDDeviceFS.
---
src/lxc/lxc_controller.c | 96
1 file changed, 49 insertions(+), 47 deletions(-)
diff --git
nnect for the specified device.
References
--
[1] https://libvirt.org/formatdomain.html#elementsFilesystems
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1328946
[3] https://pastebin.com/raw/jMBk5mtG
[4] https://pastebin.com/raw/wTKbuRP9
Radostin Stoyanov (3):
lxc: Make lxcContaine
---
src/lxc/lxc_container.c | 5 +
src/lxc/lxc_container.h | 4
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 532fd0be0..3b8cb966e 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -113,9 +113,6
Radostin Stoyanov (2):
lxc: s/subtreee/subtree/
lxc: Clean up /.oldroot
src/lxc/lxc_container.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
--
2.14.3
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/lxc/lxc_container.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 532fd0be0..665b93a0a 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_conta
Remove the /.oldroot directory after it has been unmounted (at the end
of lxcContainerSetupPivotRoot). Ignore errors silently.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/lxc/lxc_container.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lxc/lxc_container.c
On 13/04/18 08:35, Michal Privoznik wrote:
> On 04/13/2018 08:01 AM, Radostin Stoyanov wrote:
>> Remove unnecessary virFileIsExecutable check after virFindFileInPath.
>> Since the commit 9ae992f virFindFileInPath will reject non-executables.
>>
>> 9ae992f24353d
Remove unnecessary virFileIsExecutable check after virFindFileInPath.
Since commit 9ae992f, virFindFileInPath will reject non-executables.
9ae992f24353d6506f570fc9dd58355b165e4472
virFindFileInPath: only find executable non-directory
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.
Remove unnecessary virFileIsExecutable check after virFindFileInPath.
Since the commit 9ae992f virFindFileInPath will reject non-executables.
9ae992f24353d6506f570fc9dd58355b165e4472
virFindFileInPath: only find executable non-directory
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.
On 11/04/18 12:34, Daniel P. Berrangé wrote:
> On Wed, Apr 11, 2018 at 12:29:11PM +0100, Radostin Stoyanov wrote:
>> This patch set contains rebased version of Katerina's work from GSoC 2016
>> [1].
>> It allows integrates CRIU [2] with the libvirt-lxc to enable save/resore o
Extend `lxcContainerStart` with support for restore from fd
of directory that contains saved state of lxc container.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/lxc/lxc_container.c | 162 +--
src/lxc/lxc_container.h | 3 +
Checkpoint/restore in User-space [1] enables the current running state
of lxc containers to be stored as a set of image files. Then, one could
restore the container to its previous state (before checkpointing) on
the same or another system.
[1] https://criu.org/
Signed-off-by: Radostin Stoyanov
Add helper functions for checkpoint/restore of linux containers using
CRIU.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
po/POTFILES.in | 1 +
src/lxc/Makefile.inc.am | 4 +
src/lxc/lxc_criu.c | 253
s
-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/lxc/lxc_driver.c | 234 +++
1 file changed, 234 insertions(+)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index f52085ebf..871e853a0 100644
--- a/src/lxc/lxc_driver.c
+++ b/s
This patch set contains rebased version of Katerina's work from GSoC 2016 [1].
It allows integrates CRIU [2] with the libvirt-lxc to enable save/resore of
containers.
[1] https://wiki.libvirt.org/page/Google_Summer_of_Code_2016/lxc_migration
[2] https://criu.org
Radostin Stoyanov (4
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/lxc/lxc_container.c | 2 +-
src/lxc/lxc_container.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 14928e8ec..532fd0be0 100644
--- a/s
|[]=><".find(line[i]) == -1):
Will be True for every character that is not in string:
" \t(){}:;,+-*/%&!|[]=><"
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 44 +++-
1 file changed, 15 inse
Reduce the number of if-statements used to assign a literals
to corresponding class variables.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 31 +--
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/docs/apibuil
Backslash between brackets in Python is redundant. [1]
1: https://lintlyci.github.io/Flake8Rules/rules/E502.html
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git
Replace the print statement, that is only available in Py2, with a
print function that is available in both Py2 and Py3 and drop the
explicit python version in the shebang.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
tests/cputestdata/cpu-reformat.py | 4 ++--
1 file chan
The method strip_lead_star() removes a single leading asterisk
character from a string by ignoring leading whitespace, otherwise it
returns the original string.
This could be achieved with a single if-statement followed by replace.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.
http://pylint-messages.wikidot.com/messages:c0325
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 74
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 18 +-
docs/index.py | 6 +++---
tests/cputestdata/cpu-cpuid.py | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py
The function generate_helper_header() only returns a formatted string.
This could be achieved without performing string concatenation.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/esx/esx_vi_generator.py | 22 +-
1 file changed, 9 insertions(
The generate_helper_source() function returns a formatted string.
This could be achieved without the use of a local variable "source"
and string concatenation.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/esx/esx_vi_generator.py | 31 ---
PEP8 recommends removing whitespace immediately before a comma,
semicolon, or colon [1]. In addition remove multiple spaces after
keyword (PEP8 - E271).
1:
https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.
PEP8 recommends not having spaces around = in a keyword argument or
a default parameter value.
https://www.python.org/dev/peps/pep-0008/#other-recommendations
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 24
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 1f9c8f12c..5e218a9ad 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -432,21 +
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 98224c7e7..4c8fa5740 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -478,8 +478,8 @@ class
PEP8 recommends that the number of spaces used for indentation of
Python code to be a multiple of four [1] [2].
1: https://lintlyci.github.io/Flake8Rules/rules/E111.html
2: https://lintlyci.github.io/Flake8Rules/rules/E114.html
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
Improve readability and reduce the complexity of the code that is
searching for string tokens (i.e. characters surrounded by a single
or double quote).
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 32 ++--
1 file chang
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index f073b36c7..98224c7e7 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -471,8 +471,7 @@ class
Improve readability and reduce complexity the method
parseTypeComment().
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 42 --
1 file changed, 16 insertions(+), 26 deletions(-)
diff --git a/docs/apibuild.py
The uniq() function returns a sorted list, there is no need
to sort this list again.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
Use a set (unordered collections of unique elements) [1] to remove
repeated elements in a list.
1: https://docs.python.org/3/tutorial/datastructures.html#sets
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 6 +-
1 file changed, 1 insertion(+), 5 del
The functions like isalnum(), isalpha(), isdigit(), etc. are also
available in Python, however `make syntax-check` do not intend to
prohibit them.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
cfg.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/cfg.mk b/cfg.mk
= Test()
A.mylist.append("mylist from instance A")
print(B.mylist) # Will print ['mylist from instance A']
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/hyperv/hyperv_wmi_generator.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --
Reduce the number of if-statements and use a single return.
Utilise a dictionary to map between occurrences and values.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/esx/esx_vi_generator.py | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
diff
Generate whitespace using the standard function ljust() that is
available in both Py3 [1] and Py2 [2].
1: https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.ljust
2: https://docs.python.org/2.7/library/string.html#string.ljust
Signed-off-by: Radostin Stoyanov <rsto
The isinstance() function [1] returns true if an object argument is an
instance of a classinfo argument or of a direct, indirect subclass
thereof.
1: https://docs.python.org/3/library/functions.html#isinstance
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.
patches were applied.
Radostin Stoyanov (25):
apibuild: Use isinstance for type checking
apibuild: Split imports on separate lines
apibuild: Remove whitespace before ',' and ':'
python: Add whitespace around = and % operators
esx_vi_generator: Simplify generate_helper_source
esx_vi
PEP8 recommends imports to be on separate lines. [1]
1: https://www.python.org/dev/peps/pep-0008/#imports
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
On 19/03/18 10:52, Daniel P. Berrangé wrote:
>> -o = ord(line[i])
>> -if (o >= 97 and o <= 122) or (o >= 65 and o <= 90) or \
>> - (o >= 48 and o <= 57):
>> +if re.match(r"[a-zA-Z0-9]", line[i]):
> Why not just use isalnum()
On 19/03/18 11:40, Marc Hartmayer wrote:
> On Sat, Mar 17, 2018 at 03:23 PM +0100, Radostin Stoyanov
> <rstoyan...@gmail.com> wrote:
>> Reduce the number of if-statements and use a single return.
>> Utilise a dictionary to map between occurrences and values.
>>
>&
On 19/03/18 10:42, Daniel P. Berrangé wrote:
> On Sat, Mar 17, 2018 at 02:23:23PM +0000, Radostin Stoyanov wrote:
>> The generate_helper_source() function returns a formatted string.
>> This could be achieved without the use of a local variable "source"
>> and str
On 19/03/18 11:03, Daniel P. Berrangé wrote:
> On Mon, Mar 19, 2018 at 10:36:28AM +, Daniel P. Berrangé wrote:
>> On Sat, Mar 17, 2018 at 02:23:18PM +, Radostin Stoyanov wrote:
>>> These patches improve the code style of python code
>>> by applyin
Improve readability and reduce the complexity of the code that is
searching for string tokens (i.e. characters surrounded by a single
or double quote).
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 32 ++--
1 file chang
These patches improve the code style of python code
by applying some PEP8 recommendations and simplifying
some functions.
Radostin Stoyanov (22):
apibuild: Use isinctance for type checking
apibuild: Split imports on separate lines
apibuild: Remove whitespace before ',' and ':'
python: Add
Backslash between brackets in Python is redundant. [1]
1: https://lintlyci.github.io/Flake8Rules/rules/E502.html
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git
PEP8 recommends imports to be on separate lines. [1]
1: https://www.python.org/dev/peps/pep-0008/#imports
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 29c89fd24..f9784f9bd 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -472,8 +472,7 @@ class
Replace the print statement, that is only available in Py2, with a
print function that is available in both Py2 and Py3 and drop the
explicit python version in the shebang.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
tests/cputestdata/cpu-reformat.py | 4 ++--
1 file chan
PEP8 recommends not having spaces around = in a keyword argument or
a default parameter value.
https://www.python.org/dev/peps/pep-0008/#other-recommendations
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 24
PEP8 recommends that the number of spaces used for indentation of
Python code to be a multiple of four [1] [2].
1: https://lintlyci.github.io/Flake8Rules/rules/E111.html
2: https://lintlyci.github.io/Flake8Rules/rules/E114.html
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
The method strip_lead_star() removes a single leading asterisk
character from a string by ignoring leading whitespace, otherwise it
returns the original string.
This could be achieved with a single if-statement followed by replace.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.
The uniq() function returns a sorted list, there is no need
to sort this list again.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
= Test()
A.mylist.append("mylist from instance A")
print(B.mylist) # Will print ['mylist from instance A']
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/hyperv/hyperv_wmi_generator.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 18 +-
docs/index.py | 6 +++---
tests/cputestdata/cpu-cpuid.py | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py
Use a set (unordered collections of unique elements) [1] to remove
repeated elements in a list.
1: https://docs.python.org/3/tutorial/datastructures.html#sets
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 6 +-
1 file changed, 1 insertion(+), 5 del
Generate whitespace using the standard function ljust() that is
available in both Py3 [1] and Py2 [2].
1: https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.ljust
2: https://docs.python.org/2.7/library/string.html#string.ljust
Signed-off-by: Radostin Stoyanov <rsto
|[]=><".find(line[i]) == -1):
Will be True for every character that is not in string:
" \t(){}:;,+-*/%&!|[]=><"
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 33 ++---
1 file changed, 10 inse
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index f9784f9bd..24e0eb505 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -479,8 +479,8 @@ class
Reduce the number of if-statements and use a single return.
Utilise a dictionary to map between occurrences and values.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
src/esx/esx_vi_generator.py | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff
PEP8 recommends removing whitespace immediately before a comma,
semicolon, or colon [1]. In addition remove multiple spaces after
keyword (PEP8 - E271).
1:
https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.
Reduce the number of if-statements used to assign a literals
to corresponding class variables.
Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
docs/apibuild.py | 31 +--
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/docs/apibuil
1 - 100 of 106 matches
Mail list logo