Skip to content

Commit

Permalink
Add a shot version of xcp-ng
Browse files Browse the repository at this point in the history
A short version is needed to get the list of extra packages because the
URL to get the list only uses major.minor.

Signed-off-by: Guillaume <[email protected]>
  • Loading branch information
gthvn1 committed Jul 20, 2023
1 parent e8655aa commit 823c3e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, pool, hostname_or_ip):
self.inventory = self._get_xensource_inventory()
self.uuid = self.inventory['INSTALLATION_UUID']
self.xcp_version = version.parse(self.inventory['PRODUCT_VERSION'])
self.xcp_version_short = f"{self.xcp_version.major}.{self.xcp_version.minor}"

def __str__(self):
return self.hostname_or_ip
Expand Down Expand Up @@ -98,8 +99,7 @@ def create_file(self, filename, text):

def add_xcpng_repo(self, name):
major = self.xcp_version.major
minor = self.xcp_version.minor
version = f"{major}.{minor}"
version = self.xcp_version_short
self.create_file(f"/etc/yum.repos.d/xcp-ng-{name}.repo", (
f"[xcp-ng-{name}]\n"
f"name=XCP-ng {name} Repository\n"
Expand Down
2 changes: 1 addition & 1 deletion tests/packages/extra/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@pytest.fixture(scope="session")
def extra_pkgs(host):
version = host.xcp_version
version = host.xcp_version_short
url = f"https://reports.xcp-ng.org/{version}/extra_installable.txt"

logging.info(f"Getting extra packages from {url}")
Expand Down

0 comments on commit 823c3e9

Please sign in to comment.