Skip to content

Commit

Permalink
[DB-7671] Packaging: Fix packaging URLs from the package_manifest
Browse files Browse the repository at this point in the history
Summary:
Fix packaging URLs from the package_manifest
Jira: DB-7671

Test Plan: jenkins: build type: release

Reviewers: devops, steve.varnau

Reviewed By: steve.varnau

Subscribers: devops

Differential Revision: https://phorge.dev.yugabyte.com/D41602
  • Loading branch information
jharveysmith committed Jan 31, 2025
1 parent 31dc766 commit 00ba3fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/yugabyte/command_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def copy_deep(src: str, dst: str, create_dst_dir: bool = False) -> None:
logging.debug("Pulling {} to {} from the web".format(src, dst))
opener = urllib.request.URLopener()
opener.addheader('User-Agent', 'yugabyte') # type: ignore[arg-type]
opener.retrieve(src, os.path.join(dst, os.path.basename(src)))
opener.retrieve(src, dst)
elif os.path.isdir(src) and not src_is_link:
logging.debug("Copying directory {} to {}".format(src, dst))
mkdir_p(dst)
Expand Down
16 changes: 10 additions & 6 deletions python/yugabyte/release_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,18 @@ def _rewrite_manifest(self) -> None:
for i in range(len(values)):
values[i] = self.expand_value(values[i])

def repo_expand_path(self, path: str) -> str:
def repo_expand_path(self, path: str) -> List[str]:
"""
If path is relative treat it as a path within repo and make it absolute.
"""
if not path.startswith('/'):
path = os.path.join(YB_SRC_ROOT, path)
return path
return_path = []
if path.startswith('http'):
return_path = [path]
else:
if not path.startswith('/'):
path = os.path.join(YB_SRC_ROOT, path)
return_path = glob.glob(path)
return return_path

def create_distribution(self, distribution_dir: str) -> None:
"""This method would read the release_manifest and traverse through the
Expand All @@ -227,8 +232,7 @@ def create_distribution(self, distribution_dir: str) -> None:
for elem in self.release_manifest[dir_from_manifest]:
if not elem:
continue
elem = self.repo_expand_path(elem)
files = glob.glob(elem)
files = self.repo_expand_path(elem)
for file_path in files:
copy_deep(file_path,
os.path.join(current_dest_dir, os.path.basename(file_path)))
Expand Down

0 comments on commit 00ba3fb

Please sign in to comment.