Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pvirsh for openSUSE:Factory checked in at 2023-03-03 22:28:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pvirsh (Old) and /work/SRC/openSUSE:Factory/.pvirsh.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pvirsh" Fri Mar 3 22:28:16 2023 rev:2 rq:1069114 version:2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/pvirsh/pvirsh.changes 2023-01-18 13:08:49.412126706 +0100 +++ /work/SRC/openSUSE:Factory/.pvirsh.new.31432/pvirsh.changes 2023-03-03 22:31:16.543997605 +0100 @@ -1,0 +2,10 @@ +Fri Mar 3 08:59:44 UTC 2023 - Antoine Ginies <agin...@suse.com> + +- version 2.2: + * again some lint fixes + * remove unwanted shebang + * various typo fixes + * bug fixes + * add requires on python3-curses + +------------------------------------------------------------------- Old: ---- pvirsh-2.1.tar.gz New: ---- pvirsh-2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pvirsh.spec ++++++ --- /var/tmp/diff_new_pack.umkw0A/_old 2023-03-03 22:31:17.091999942 +0100 +++ /var/tmp/diff_new_pack.umkw0A/_new 2023-03-03 22:31:17.095999959 +0100 @@ -19,9 +19,9 @@ %define pythons python3 Name: pvirsh -Version: 2.1 +Version: 2.2 Release: 0 -Summary: Parallel virsh command +Summary: Parallel virsh command to manage a selected group of Virtual Machine License: GPL-3.0-or-later Group: System/Management URL: https://github.com/aginies/pvirsh @@ -33,6 +33,7 @@ BuildRequires: fdupes Requires: python3-libvirt-python Requires: python3-PyYAML +Requires: python3-curses BuildArch: noarch %python_subpackages ++++++ pvirsh-2.1.tar.gz -> pvirsh-2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/ChangeLog new/pvirsh-2.2/ChangeLog --- old/pvirsh-2.1/ChangeLog 2022-12-12 11:47:15.000000000 +0100 +++ new/pvirsh-2.2/ChangeLog 2023-03-03 09:56:00.000000000 +0100 @@ -1,3 +1,23 @@ +2023-02-24 aginies <agin...@suse.com> + + code optimized by my new trainee + + +2023-01-17 aginies <agin...@suse.com> + + remove unwanted shebang + + +2022-12-19 aginies <agin...@suse.com> + + update info about select_vm + + +2022-12-12 Antoine Giniès <agin...@gmail.com> + + typo fix + typo fix + 2022-11-28 aginies <agin...@suse.com> fix missing else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/PKG-INFO new/pvirsh-2.2/PKG-INFO --- old/pvirsh-2.1/PKG-INFO 2022-12-12 11:47:15.000000000 +0100 +++ new/pvirsh-2.2/PKG-INFO 2023-03-03 09:56:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pvirsh -Version: 2.1 +Version: 2.2 Summary: Parallel virsh command Home-page: https://github.com/aginies/pvirsh Author: Antoine Ginies @@ -10,8 +10,8 @@ EXPERIMENTATION FOR [ALP OS](https://documentation.suse.com/alp/all/) - This wrapper is a **parallel virsh** command to manage selected group of Virtual Machine. - This provide an easy way to execute the same **command** on a **selected group of Virtual Machine**. + This wrapper is a **parallel virsh** command to manage a selected group of Virtual Machine. + This provides an easy way to execute the same **command** on a **selected group of Virtual Machine**. If you want to manage more than 1 VM you need to script you action and this will be done in a sequential way (most of the time). @@ -50,7 +50,9 @@ # Define Virtual Machine groups - By default the script will use **groups.yaml** in the same path. + It is possible to select VM directly on the connected hypervisir with **select_vm**, + or you can use a group yaml file which contains list of VM per group. + By default the script will use **groups.yaml**. The **yaml** file looks like: ```yaml @@ -70,6 +72,8 @@ * sle15sp31$ : will match exactly this machine name * sle15sp4 : will match all VM, including sle15sp4* + NOTE: select_vm is only available in interactive mode. + # TODO Probably a lot as this is for testing purpose... @@ -81,7 +85,6 @@ ```bash usage: Interactive or Non Interactive command tool to manage multiple VM at the same Time - Version: 1.2 Non interactive: pvirsh -n -f GROUP.yaml --conn CONNECTOR -g VM_GROUP,VM_GROUP2 -c 'CMD CMD_OPTION' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/README.md new/pvirsh-2.2/README.md --- old/pvirsh-2.1/README.md 2022-10-14 16:21:54.000000000 +0200 +++ new/pvirsh-2.2/README.md 2022-12-21 19:57:48.000000000 +0100 @@ -2,8 +2,8 @@ EXPERIMENTATION FOR [ALP OS](https://documentation.suse.com/alp/all/) -This wrapper is a **parallel virsh** command to manage selected group of Virtual Machine. -This provide an easy way to execute the same **command** on a **selected group of Virtual Machine**. +This wrapper is a **parallel virsh** command to manage a selected group of Virtual Machine. +This provides an easy way to execute the same **command** on a **selected group of Virtual Machine**. If you want to manage more than 1 VM you need to script you action and this will be done in a sequential way (most of the time). @@ -42,7 +42,9 @@ # Define Virtual Machine groups -By default the script will use **groups.yaml** in the same path. +It is possible to select VM directly on the connected hypervisir with **select_vm**, +or you can use a group yaml file which contains list of VM per group. +By default the script will use **groups.yaml**. The **yaml** file looks like: ```yaml @@ -62,6 +64,8 @@ * sle15sp31$ : will match exactly this machine name * sle15sp4 : will match all VM, including sle15sp4* +NOTE: select_vm is only available in interactive mode. + # TODO Probably a lot as this is for testing purpose... @@ -73,7 +77,6 @@ ```bash usage: Interactive or Non Interactive command tool to manage multiple VM at the same Time - Version: 1.2 Non interactive: pvirsh -n -f GROUP.yaml --conn CONNECTOR -g VM_GROUP,VM_GROUP2 -c 'CMD CMD_OPTION' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/setup.py new/pvirsh-2.2/setup.py --- old/pvirsh-2.1/setup.py 2022-11-04 18:07:41.000000000 +0100 +++ new/pvirsh-2.2/setup.py 2023-03-03 09:55:58.000000000 +0100 @@ -188,20 +188,19 @@ os.mkdir("build") if os.path.exists(".git"): - try: - self.gen_authors() - self.gen_changelog() - - sdist.run(self) - - finally: - files = ["AUTHORS", "ChangeLog"] - for item in files: - if os.path.exists(item): - os.unlink(item) - else: + #try: + self.gen_authors() + self.gen_changelog() sdist.run(self) + #finally: + #files = ["AUTHORS", "ChangeLog"] + #for item in files: + #if os.path.exists(item): + #os.unlink(item) + #else: + # sdist.run(self) + setuptools.setup( name="pvirsh", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/src/groups.yaml new/pvirsh-2.2/src/groups.yaml --- old/pvirsh-2.1/src/groups.yaml 2022-10-11 17:19:11.000000000 +0200 +++ new/pvirsh-2.2/src/groups.yaml 2023-03-03 09:53:26.000000000 +0100 @@ -1,3 +1,6 @@ +# sle15sp31$ : will match exactly this machine name +# sle15sp4 : will match all VM, including all machine name like: sle15sp4* +# suse: - sle15sp31$ - sle15sp4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/src/pvirsh/__init__.py new/pvirsh-2.2/src/pvirsh/__init__.py --- old/pvirsh-2.1/src/pvirsh/__init__.py 2022-10-19 14:37:10.000000000 +0200 +++ new/pvirsh-2.2/src/pvirsh/__init__.py 2023-03-03 09:52:00.000000000 +0100 @@ -30,4 +30,4 @@ builtins.__dict__["_"] = str -__version__ = "2.1" +__version__ = "2.2" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/src/pvirsh/connection.py new/pvirsh-2.2/src/pvirsh/connection.py --- old/pvirsh-2.1/src/pvirsh/connection.py 2022-11-16 17:47:47.000000000 +0100 +++ new/pvirsh-2.2/src/pvirsh/connection.py 2023-01-17 10:26:37.000000000 +0100 @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # Authors: Antoine Ginies <agin...@suse.com> # # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/src/pvirsh/util.py new/pvirsh-2.2/src/pvirsh/util.py --- old/pvirsh-2.1/src/pvirsh/util.py 2022-11-16 17:38:03.000000000 +0100 +++ new/pvirsh-2.2/src/pvirsh/util.py 2023-02-24 16:50:48.000000000 +0100 @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # Authors: Antoine Ginies <agin...@suse.com> # # This program is free software: you can redistribute it and/or modify @@ -217,47 +216,55 @@ vms = find_matching_vm(file, group, conn) return vms - def find_matching_vm(groupfile, group, conn): """ Return the list of VM matching the group """ with open(groupfile) as file: groups = yaml.full_load(file) - vms = "" - for item, value in groups.items(): - # only match vm of the correct group - if item == group: - print('Selected group is ' +esc('36;1;4')+item+esc(0)+ ': ' + str(value)) - # get the list of domain from the host - domains = conn.listAllDomains(0) - # check if there is a domain - if len(domains) != 0: - # parse VM list on the host - for domain in domains: - # parse all VM which should be matched in the group.yaml file (virtum) - for virtum in value: - vmdomain = domain.name() - # check the regex contains $ at the end - if virtum.endswith('$'): - # spliting the check - check = virtum.split('$') - # if same start and ending with $ this is an exact match - if vmdomain.startswith(check[0]): - #print('exact matching ' +vmdomain +' ' +virtum) - vms = vmdomain + ' ' +vms - else: - #print('not exact matching ' +vmdomain +' ' +virtum) - pass - # case of regex does not finish with $ - else: - # we can compare directly the vmdomain with the virtum start string - if vmdomain.startswith(virtum): - #print('matching ' +vmdomain +' ' +virtum) - vms = vmdomain + ' ' +vms - else: - #print('doesnt match anything....') - pass + + # Get the value list for the selected group, or return an empty list if it doesn't exist + value = groups.get(group, []) + if not value: + print_error(f"No group '{group}' found in {groupfile}") + return "" + + print(f"Selected group is {esc('36;1;4')}{group}{esc(0)}: {value}") + + # Get the list of domain from the host + domains = conn.listAllDomains(0) + + # check if there is a domain + if not domains: + print_error('No domain to manage on this host!') + return "" + + vms = [] + # parse VM list on the host + for domain in domains: + vmdomain = domain.name() + + # parse all VM which should be matched in the group.yaml file (virtum) + for virtum in value: + # check the regex contains $ at the end + if virtum.endswith('$'): + # spliting the check + check = virtum.split('$') + # if same start and ending with $ this is an exact match + if vmdomain.startswith(check[0]): + vms.append(vmdomain) + #print('exact matching ' +vmdomain +' ' +virtum) + else: + #print('not exact matching ' +vmdomain +' ' +virtum) + pass + # case of regex does not finish with $ else: - print_error('No domain to manage on this host!') - return vms + # we can compare directly the vmdomain with the virtum start string + if vmdomain.startswith(virtum): + vms.append(vmdomain) + #print('matching ' +vmdomain +' ' +virtum) + else: + #print('doesnt match anything....') + pass + + return ' '.join(vms) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pvirsh-2.1/src/pvirsh.egg-info/PKG-INFO new/pvirsh-2.2/src/pvirsh.egg-info/PKG-INFO --- old/pvirsh-2.1/src/pvirsh.egg-info/PKG-INFO 2022-12-12 11:47:15.000000000 +0100 +++ new/pvirsh-2.2/src/pvirsh.egg-info/PKG-INFO 2023-03-03 09:56:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pvirsh -Version: 2.1 +Version: 2.2 Summary: Parallel virsh command Home-page: https://github.com/aginies/pvirsh Author: Antoine Ginies @@ -10,8 +10,8 @@ EXPERIMENTATION FOR [ALP OS](https://documentation.suse.com/alp/all/) - This wrapper is a **parallel virsh** command to manage selected group of Virtual Machine. - This provide an easy way to execute the same **command** on a **selected group of Virtual Machine**. + This wrapper is a **parallel virsh** command to manage a selected group of Virtual Machine. + This provides an easy way to execute the same **command** on a **selected group of Virtual Machine**. If you want to manage more than 1 VM you need to script you action and this will be done in a sequential way (most of the time). @@ -50,7 +50,9 @@ # Define Virtual Machine groups - By default the script will use **groups.yaml** in the same path. + It is possible to select VM directly on the connected hypervisir with **select_vm**, + or you can use a group yaml file which contains list of VM per group. + By default the script will use **groups.yaml**. The **yaml** file looks like: ```yaml @@ -70,6 +72,8 @@ * sle15sp31$ : will match exactly this machine name * sle15sp4 : will match all VM, including sle15sp4* + NOTE: select_vm is only available in interactive mode. + # TODO Probably a lot as this is for testing purpose... @@ -81,7 +85,6 @@ ```bash usage: Interactive or Non Interactive command tool to manage multiple VM at the same Time - Version: 1.2 Non interactive: pvirsh -n -f GROUP.yaml --conn CONNECTOR -g VM_GROUP,VM_GROUP2 -c 'CMD CMD_OPTION'