Skip to content

Commit

Permalink
Merge pull request #190 from stackhpc/upstream/zed-2023-10-18
Browse files Browse the repository at this point in the history
Synchronise zed with upstream
  • Loading branch information
priteau authored Oct 18, 2023
2 parents 6d32173 + a1a1f8d commit 87f14fc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 13 deletions.
3 changes: 2 additions & 1 deletion kayobe/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,8 @@ class OvercloudDeprovision(KayobeAnsibleMixin, VaultMixin, Command):

def take_action(self, parsed_args):
self.app.LOG.debug("Deprovisioning overcloud")
playbooks = _build_playbook_list("overcloud-deprovision")
playbooks = _build_playbook_list("kolla-bifrost-hostvars",
"overcloud-deprovision")
self.run_kayobe_playbooks(parsed_args, playbooks)


Expand Down
2 changes: 2 additions & 0 deletions kayobe/tests/unit/cli/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,8 @@ def test_overcloud_deprovision(self, mock_run):
mock.call(
mock.ANY,
[
utils.get_data_files_path(
"ansible", "kolla-bifrost-hostvars.yml"),
utils.get_data_files_path(
"ansible", "overcloud-deprovision.yml"),
],
Expand Down
22 changes: 22 additions & 0 deletions kayobe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import base64
import glob
from importlib.metadata import Distribution
import json
import logging
import os
import shutil
Expand Down Expand Up @@ -48,10 +50,30 @@ def _detect_install_prefix(path):
return prefix_path


def _get_direct_url(dist):
direct_url = os.path.join(dist._path, 'direct_url.json')
if os.path.isfile(direct_url):
with open(direct_url, 'r') as f:
direct_url_content = json.loads(f.readline().strip())
url = direct_url_content['url']
prefix = 'file://'
if url.startswith(prefix):
return url[len(prefix):]

return None


def _get_base_path():
override = os.environ.get("KAYOBE_DATA_FILES_PATH")
if override:
return os.path.join(override)

kayobe_dist = list(Distribution.discover(name="kayobe"))
if kayobe_dist:
direct_url = _get_direct_url(kayobe_dist[0])
if direct_url:
return direct_url

egg_glob = os.path.join(
sys.prefix, 'lib*', 'python*', '*-packages', 'kayobe.egg-link'
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
Fixes failure to run ``kayobe overcloud deprovision`` after Bifrost is
redeployed.
`LP#2038889 <https://bugs.launchpad.net/kolla-ansible/+bug/2038889>`__
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixes detection of data file path when using editable installations with a
recent pip.
16 changes: 4 additions & 12 deletions zuul.d/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
- kayobe-tox-molecule
- kayobe-overcloud-rocky9
- kayobe-overcloud-centos9s
# NOTE(mattcrees): Job temporarily disabled until fix is merged, see:
# https://review.opendev.org/c/openstack/kolla/+/885857
# - kayobe-overcloud-ubuntu-jammy
- kayobe-overcloud-ubuntu-jammy
- kayobe-overcloud-tls-rocky9
- kayobe-overcloud-host-configure-rocky9
- kayobe-overcloud-host-configure-centos9s
- kayobe-overcloud-host-configure-ubuntu-jammy
# NOTE(mattcrees): Job temporarily disabled until fix is merged, see:
# https://review.opendev.org/c/openstack/kolla/+/885857
# - kayobe-overcloud-upgrade-ubuntu-focal
- kayobe-overcloud-upgrade-ubuntu-focal
- kayobe-seed-rocky9
- kayobe-seed-ubuntu-jammy
- kayobe-seed-images-rocky9
Expand All @@ -38,15 +34,11 @@
- kayobe-tox-ansible
- kayobe-tox-molecule
- kayobe-overcloud-rocky9
# NOTE(mattcrees): Job temporarily disabled until fix is merged, see:
# https://review.opendev.org/c/openstack/kolla/+/885857
# - kayobe-overcloud-ubuntu-jammy
- kayobe-overcloud-ubuntu-jammy
- kayobe-overcloud-tls-rocky9
- kayobe-overcloud-host-configure-rocky9
- kayobe-overcloud-host-configure-ubuntu-jammy
# NOTE(mattcrees): Job temporarily disabled until fix is merged, see:
# https://review.opendev.org/c/openstack/kolla/+/885857
# - kayobe-overcloud-upgrade-ubuntu-focal
- kayobe-overcloud-upgrade-ubuntu-focal
- kayobe-seed-rocky9
- kayobe-seed-ubuntu-jammy
- kayobe-seed-upgrade-ubuntu-focal
Expand Down

0 comments on commit 87f14fc

Please sign in to comment.