Commit a6df36bb authored by Rocky Automation's avatar Rocky Automation 📺
Browse files

import virt-who-1.30.12-2.el8_6

parent 01b76e64
diff --git a/rel-eng/packages/virt-who b/rel-eng/packages/virt-who
index 0689815..98ff6fb 100644
--- a/rel-eng/packages/virt-who
+++ b/rel-eng/packages/virt-who
@@ -1 +1 @@
-1.30.12-1 ./
+1.30.12-2 ./
diff --git a/rel-eng/releasers.conf b/rel-eng/releasers.conf
index 2a0d36a..5f5247c 100644
--- a/rel-eng/releasers.conf
+++ b/rel-eng/releasers.conf
@@ -1,97 +1,20 @@
[fedora]
releaser = tito.release.FedoraGitReleaser
-branches = master f31 f30
+branches = main f35 f34
-[rhel-7.2]
-releaser = tito.release.DistGitReleaser
-branches = rhel-7.2
-required_bz_flags = rhel-7.2.0+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-#placeholder_bz = 1109810
-
-[rhel-7.4]
-releaser = tito.release.DistGitReleaser
-branches = rhel-7.4
-required_bz_flags = rhel-7.4.0+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-placeholder_bz = 1429752
-
-[rhel-7.5]
-releaser = tito.release.DistGitReleaser
-branches = rhel-7.5
-required_bz_flags = rhel-7.5.0+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-#placeholder_bz = 1429752
-
-[rhel-7.6]
-releaser = tito.release.DistGitReleaser
-branches = rhel-7.6
-required_bz_flags = rhel-7.6.0+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-placeholder_bz = 1589896
-
-[rhel-7.7]
-releaser = tito.release.DistGitReleaser
-branches = rhel-7.7
-required_bz_flags = rhel-7.7.0+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-placeholder_bz = 1631013
-
-[rhel-8.0]
-releaser = tito.release.DistGitReleaser
-branches = rhel-8.0.0
-required_bz_flags = release+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-placeholder_bz = 1615613
-
-[rhel-8.1]
-releaser = tito.release.DistGitReleaser
-branches = rhel-8.1.0
-required_bz_flags = release+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-placeholder_bz = 1708477
-
-[rhel-8.2]
-releaser = tito.release.DistGitReleaser
-branches = rhel-8.2.0
-required_bz_flags = release+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-placeholder_bz = 1762606
-
-[rhel-8.3]
-releaser = tito.release.DistGitReleaser
-branches = rhel-8.3.0
-required_bz_flags = release+
-# Change this if you wish to use a placeholder "rebase" bug if none
-# are found in the changelog.
-placeholder_bz = 1815373
-
-[rhel-8.4]
+[rhel-8.5]
releaser = tito.release.DistGitReleaser
-branches = rhel-8.4.0
+branches = rhel-8.5.0
required_bz_flags = release+
# Change this if you wish to use a placeholder "rebase" bug if none
# are found in the changelog.
-placeholder_bz = 1873606
+placeholder_bz =
-[rhel-8.5]
+[rhel-8.6]
releaser = tito.release.DistGitReleaser
-branches = rhel-8.5.0
+branches = rhel-8.6.0
required_bz_flags = release+
# Change this if you wish to use a placeholder "rebase" bug if none
# are found in the changelog.
placeholder_bz =
-#[copr-dgoodwin]
-#releaser = tito.release.CoprReleaser
-#project_name = virt-who
-#upload_command = scp %(srpm)s rm-rf.ca:/home/dgoodwin/public_html/copr/
-#remote_location = http://rm-rf.ca/~dgoodwin/copr/
diff --git a/virt-who.spec b/virt-who.spec
index 45815eb..dc10acd 100644
--- a/virt-who.spec
+++ b/virt-who.spec
@@ -21,7 +21,7 @@
Name: virt-who
Version: 1.30.12
-Release: %{release_number}%{?dist}
+Release: 2%{?dist}
Summary: Agent for reporting virtual guest IDs to subscription-manager
@@ -167,6 +167,11 @@ fi
%changelog
+* Wed Sep 21 2022 Jiri Hnidek <jhnidek@redhat.com> 1.30.12-2
+- 2124813: [1.30.12] Nutanix: Gather information about VMs correctly
+ (jhnidek@redhat.com)
+- Update releasers for current needs (wpoteat@redhat.com)
+
* Tue Feb 08 2022 William Poteat <wpoteat@redhat.com> 1.30.12-1
- Run complex tests as forked for consistent results (wpoteat@redhat.com)
- 1996944: Use cluster name instead of UUID for fabric consistency
diff --git a/virtwho/virt/ahv/ahv_constants.py b/virtwho/virt/ahv/ahv_constants.py
index 95534a0..98fc32d 100644
--- a/virtwho/virt/ahv/ahv_constants.py
+++ b/virtwho/virt/ahv/ahv_constants.py
@@ -4,6 +4,7 @@ TASK_COMPLETE_MSG = ['SUCCEEDED', 'Succeeded']
DEFAULT_PORT = 9440
VERSION_2 = 'v2.0'
VERSION_3 = 'v3'
+NUM_OF_REQUESTED_VMS = 20
CMN_RST_CMD = {'get_vm': {'url': '/vms/%s', 'method': 'get'},
'get_host': {'url': '/hosts/%s', 'method': 'get'},
diff --git a/virtwho/virt/ahv/ahv_interface.py b/virtwho/virt/ahv/ahv_interface.py
index 3641b8e..f89e710 100644
--- a/virtwho/virt/ahv/ahv_interface.py
+++ b/virtwho/virt/ahv/ahv_interface.py
@@ -511,14 +511,30 @@ class AhvInterface(object):
self._logger.info("Getting the list of available vms")
is_pc=True if version == 'v3' else False
vm_uuid_list = []
- length = 0
+ length = ahv_constants.NUM_OF_REQUESTED_VMS
+ initial_offset = 0
offset = 0
total_matches = 0
count = 1
current = 0
- (url, cmd_method) = self.get_diff_ver_url_and_method(
+ url, cmd_method = self.get_diff_ver_url_and_method(
cmd_key='list_vms', intf_version=version)
- res = self.make_rest_call(method=cmd_method, uri=url)
+
+ kwargs = {
+ "method": cmd_method,
+ "uri": url
+ }
+ if is_pc is True:
+ kwargs["json"] = {
+ 'length': length,
+ 'offset': initial_offset
+ }
+ res = self.make_rest_call(**kwargs)
+
+ if res is None:
+ self._logger.error("Unable to get list of VMs")
+ return vm_uuid_list
+
data = res.json()
if 'metadata' in data:
if 'total_matches' in data['metadata'] and 'length' in data['metadata']:
@@ -534,8 +550,8 @@ class AhvInterface(object):
if length < total_matches:
self._logger.debug('Number of vms %s returned from REST is less than the total'\
- 'numberr:%s. Adjusting the offset and iterating over all'\
- 'vms until evry vm is returned from the server.' % (length,
+ 'number:%s. Adjusting the offset and iterating over all'\
+ 'vms until every vm is returned from the server.' % (length,
total_matches))
count = math.ceil(total_matches/float(length))
@@ -552,11 +568,16 @@ class AhvInterface(object):
"vm object: %s" % (vm_entity['name'],
vm_entity))
- body['offset'] = body['offset'] + length
- body_data = json.dumps(body, indent=4)
- self._logger.debug('next vm list call has this body: %s' % body)
- res = self.make_rest_call(method=cmd_method, uri=url, data=body_data)
- data = res.json()
+ if is_pc is True:
+ body['offset'] = body['offset'] + length
+ self._logger.debug('Next vm list call has this body: %s' % body)
+ kwargs["json"] = body
+ res = self.make_rest_call(**kwargs)
+ if res is not None:
+ data = res.json()
+ else:
+ self._logger.error(f"Unable to get list of VMs with offset: {body['offset']}")
+ data = {}
current += 1
self._logger.info("Total number of vms uuids found and saved for processing %s" % len(vm_uuid_list))
@@ -706,12 +727,16 @@ class AhvInterface(object):
"""
if 'resources' in vm_entity:
if 'host_reference' in vm_entity['resources']:
- return vm_entity['resources']['host_reference']['uuid']
+ vm_uuid = vm_entity['resources']['host_reference']['uuid']
+ self._logger.debug(f"Host UUID {vm_uuid} found for VM: {vm_entity['uuid']}")
+ return vm_uuid
else:
- self._logger.warning("Did not find any host information for vm:%s"
+ self._logger.warning("Did not find any host information for VM :%s"
% vm_entity['uuid'])
elif 'host_uuid' in vm_entity:
- return vm_entity['host_uuid']
+ vm_uuid = vm_entity['host_uuid']
+ self._logger.debug(f"Host UUID {vm_uuid} found for VM: {vm_entity['uuid']}")
+ return vm_uuid
else:
# Vm is off therefore no host is assigned to it.
self._logger.debug('Cannot get the host uuid of the vm:%s. '
......@@ -21,7 +21,7 @@
Name: virt-who
Version: 1.30.12
Release: %{release_number}%{?dist}
Release: 2%{?dist}
Summary: Agent for reporting virtual guest IDs to subscription-manager
......@@ -29,6 +29,7 @@ Group: System Environment/Base
License: GPLv2+
URL: https://github.com/candlepin/virt-who
Source0: %{name}-%{version}.tar.gz
Patch0: virt-who-1.30.12-1-to-virt-who-1.30.12-2.patch
BuildArch: noarch
BuildRequires: %{python_ver}-devel
......@@ -91,6 +92,7 @@ report them to the subscription manager.
%prep
%setup -q
%patch0 -p1
%build
%{python_exec} setup.py build --rpm-version=%{version}-%{release_number}
......@@ -167,6 +169,11 @@ fi
%changelog
* Wed Sep 21 2022 Jiri Hnidek <jhnidek@redhat.com> 1.30.12-2
- 2124813: [1.30.12] Nutanix: Gather information about VMs correctly
(jhnidek@redhat.com)
- Update releasers for current needs (wpoteat@redhat.com)
* Tue Feb 08 2022 William Poteat <wpoteat@redhat.com> 1.30.12-1
- Run complex tests as forked for consistent results (wpoteat@redhat.com)
- 1996944: Use cluster name instead of UUID for fabric consistency
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment