Skip to content

Commit

Permalink
Merge pull request #156 from xcp-ng/gtn-fix-extra-pkgs
Browse files Browse the repository at this point in the history
Add a short version of xcp-ng
  • Loading branch information
stormi committed Jul 20, 2023
2 parents e8655aa + 1c8325b commit b3305ec
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 b3305ec

Please sign in to comment.