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 au
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 au
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 modu
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
remote/remote_daemon
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?&q=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, on
/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
ldd /usr/libexec/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-sand
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/li
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
_MOUNT
Which makes 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
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 b/s
---
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 +113,6
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-d2023c1ac4f688aa2021e
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
---
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_image/sources/docker.py
+++ b
Pylint warning W0311 - Bad indentation
http://pylint-messages.wikidot.com/messages:w0311
Signed-off-by: Radostin Stoyanov
---
libvirt_sandbox_image/sources/docker.py | 4 ++--
scripts/virt-sandbox-image | 2 +-
setup.py| 2 +-
3 files changed, 4
Signed-off-by: Radostin Stoyanov
---
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_image/cli.py
@@ -40,9 +40,6
: Radostin Stoyanov
---
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-sandbox-image
+++ b/scripts
This changes aim to resolve Pylint C0326.
http://pylint-messages.wikidot.com/messages:c0326
Signed-off-by: Radostin Stoyanov
---
libvirt_sandbox_image/cli.py | 26 +-
libvirt_sandbox_image/sources/base.py| 4 ++--
libvirt_sandbox_image/sources
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
---
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/cli.py b/libvirt_sandbox_image/cli.py
index
Signed-off-by: Radostin Stoyanov
---
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 @@
+#!/usr/bin/env pyth
: Radostin Stoyanov
---
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
@@ -167,13 +167,11 @@ def
In Python3, the __builtin__ module is renamed to builtins.
https://docs.python.org/3/library/builtins.html#module-builtins
Signed-off-by: Radostin Stoyanov
---
libvirt_sandbox_image/cli.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt_sandbox_image/cli.py b
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.
>>
>> Signe
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 a/src/lxc/lxc_controll
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
---
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_container.c
@@ -574,7 +574,7
Remove the /.oldroot directory after it has been unmounted (at the end
of lxcContainerSetupPivotRoot). Ignore errors silently.
Signed-off-by: Radostin Stoyanov
---
src/lxc/lxc_container.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lxc/lxc_container.c b/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
---
src/bhyve
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
---
src/bhyve
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/res
Extend `lxcContainerStart` with support for restore from fd
of directory that contains saved state of lxc container.
Signed-off-by: Radostin Stoyanov
---
src/lxc/lxc_container.c | 162 +--
src/lxc/lxc_container.h | 3 +-
src/lxc/lxc_controller.c
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
---
po/POTFILES.in | 1 +
src/lxc/Makefile.inc.am | 4 +
src/lxc/lxc_criu.c | 253
src/lxc/lxc_criu.h | 36
: Radostin Stoyanov
---
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/src/lxc/lxc_driver.c
@@ -81,6 +81,7
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 Stoyan
Signed-off-by: Radostin Stoyanov
---
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/src/lxc/lxc_container.c
+++ b/src/lxc
;".find(line[i]) == -1):
Will be True for every character that is not in string:
" \t(){}:;,+-*/%&!|[]=><"
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 44 +++-
1 file changed, 15 insertions(+), 29 deletions(
Reduce the number of if-statements used to assign a literals
to corresponding class variables.
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 31 +--
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index
Backslash between brackets in Python is redundant. [1]
1: https://lintlyci.github.io/Flake8Rules/rules/E502.html
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py b/docs
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
---
tests/cputestdata/cpu-reformat.py | 4 ++--
1 file changed, 2 insertions(+), 2
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
---
docs/apibuild.py | 11
http://pylint-messages.wikidot.com/messages:c0325
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 74
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 94de13b56..1f9c8f12c
Signed-off-by: Radostin Stoyanov
---
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 b/docs/apibuild.py
index 73a7535db
The function generate_helper_header() only returns a formatted string.
This could be achieved without performing string concatenation.
Signed-off-by: Radostin Stoyanov
---
src/esx/esx_vi_generator.py | 22 +-
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/src
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
---
src/esx/esx_vi_generator.py | 31 ---
1 file changed, 12
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
---
docs/apibuild.py
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
---
docs/apibuild.py | 24
docs/index.py
Signed-off-by: Radostin Stoyanov
---
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 CLexer
Signed-off-by: Radostin Stoyanov
---
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 +432,17 @@ class CLexer
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
---
docs/apibuild.py | 32 ++--
1 file changed, 10 insertions(+), 22 deletions
Signed-off-by: Radostin Stoyanov
---
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 CLexer
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
---
docs/apibuild.py | 296
Improve readability and reduce complexity the method
parseTypeComment().
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 42 --
1 file changed, 16 insertions(+), 26 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index d5707d5d1
The uniq() function returns a sorted list, there is no need
to sort this list again.
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 1619c8836..e5e4bc83d
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
---
cfg.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/cfg.mk b/cfg.mk
index bc8088d7c..4aa26d434 100644
= Test()
A.mylist.append("mylist from instance A")
print(B.mylist) # Will print ['mylist from instance A']
Signed-off-by: Radostin Stoyanov
---
src/hyperv/hyperv_wmi_generator.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hyperv/hyp
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
---
docs/apibuild.py | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/docs
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
---
src/esx/esx_vi_generator.py | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/esx
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
---
src/esx
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
---
docs/apibuild.py | 7 +++
1 file changed, 3
the 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 genera
PEP8 recommends imports to be on separate lines. [1]
1: https://www.python.org/dev/peps/pep-0008/#imports
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 832f04ab1..7507c1d26
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() func
On 19/03/18 11:40, Marc Hartmayer wrote:
> On Sat, Mar 17, 2018 at 03:23 PM +0100, Radostin Stoyanov
> wrote:
>> Reduce the number of if-statements and use a single return.
>> Utilise a dictionary to map between occurrences and values.
>>
>> Signed-off-by: Radosti
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 applying so
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
---
docs/apibuild.py | 32 ++--
1 file changed, 10 insertions(+), 22 deletions
PEP8 recommends imports to be on separate lines. [1]
1: https://www.python.org/dev/peps/pep-0008/#imports
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 7faa083b2..190d5d93b
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 ':
Backslash between brackets in Python is redundant. [1]
1: https://lintlyci.github.io/Flake8Rules/rules/E502.html
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py b/docs
Signed-off-by: Radostin Stoyanov
---
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 CLexer
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
---
tests/cputestdata/cpu-reformat.py | 4 ++--
1 file changed, 2 insertions(+), 2
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
---
docs/apibuild.py | 24
docs/index.py
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
---
docs/apibuild.py | 298
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
---
docs/apibuild.py | 11
The uniq() function returns a sorted list, there is no need
to sort this list again.
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 149cd41cc..400be124f
Signed-off-by: Radostin Stoyanov
---
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 b/docs/apibuild.py
index 582c661e7
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
---
docs/apibuild.py | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/docs
= Test()
A.mylist.append("mylist from instance A")
print(B.mylist) # Will print ['mylist from instance A']
Signed-off-by: Radostin Stoyanov
---
src/hyperv/hyperv_wmi_generator.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hyperv/hyp
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
---
src/esx
;".find(line[i]) == -1):
Will be True for every character that is not in string:
" \t(){}:;,+-*/%&!|[]=><"
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 33 ++---
1 file changed, 10 insertions(+), 23 deletions(-)
diff -
Signed-off-by: Radostin Stoyanov
---
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 CLexer
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
---
src/esx/esx_vi_generator.py | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/esx
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
---
docs/apibuild.py
Reduce the number of if-statements used to assign a literals
to corresponding class variables.
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 31 +--
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index
1 - 100 of 106 matches
Mail list logo