Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix traceback in case source file does not exist. #79

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

phracek
Copy link
Member

@phracek phracek commented Mar 25, 2024

Fix traceback in case source file does not exist.
Also use f"" syntax instead of .format

Error from upstream->downstream was:

rh_cwt.main.distgit - DEBUG: looking for dangling symlink httpd-24/test/run (that points to httpd-24/test/../../test/run)
rh_cwt.main.distgit - DEBUG: unlink httpd-24/test/run
rh_cwt.main.distgit - DEBUG: cp upstreams/httpd/2.4/test/../../test/run httpd-24/test/run
rh_cwt.main.distgit - DEBUG: looking for dangling symlink httpd-24/test/run-openshift (that points to httpd-24/test/../../test/run-openshift)
rh_cwt.main.distgit - DEBUG: unlink httpd-24/test/run-openshift
rh_cwt.main.distgit - DEBUG: cp upstreams/httpd/2.4/test/../../test/run-openshift httpd-24/test/run-openshift
Traceback (most recent call last):
  File "/usr/local/bin/rhcwt", line 33, in <module>
    sys.exit(load_entry_point('rhcwt==0.9.8', 'console_scripts', 'rhcwt')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rh_cwt/cli.py", line 221, in run
    cli.run()
  File "/usr/local/lib/python3.11/site-packages/rh_cwt/cli.py", line 215, in run
    run_function()
  File "/usr/local/lib/python3.11/site-packages/rh_cwt/main.py", line 557, in dist_git_merge_changes
    super(RhelImageRebuilder, self).dist_git_merge_changes(rebase)
  File "/usr/local/lib/python3.11/site-packages/container_workflow_tool/main.py", line 577, in dist_git_merge_changes
    self.distgit.dist_git_merge_changes(images, rebase)
  File "/usr/local/lib/python3.11/site-packages/container_workflow_tool/distgit.py", line 99, in dist_git_merge_changes
    self.pull_upstream(component, path, url, repo, ups_name, commands)
  File "/usr/local/lib/python3.11/site-packages/container_workflow_tool/git_operations.py", line 259, in pull_upstream
    self.sync_handler.handle_dangling_symlinks(cp_path, component)
  File "/usr/local/lib/python3.11/site-packages/container_workflow_tool/sync.py", line 108, in handle_dangling_symlinks
    self.handle_dangling_symlinks(src_parent, dest_parent)
  File "/usr/local/lib/python3.11/site-packages/container_workflow_tool/sync.py", line 108, in handle_dangling_symlinks
    self.handle_dangling_symlinks(src_parent, dest_parent)
  File "/usr/local/lib/python3.11/site-packages/container_workflow_tool/sync.py", line 111, in handle_dangling_symlinks
    shutil.copy2(src_full, dest_file, follow_symlinks=False)
  File "/usr/lib64/python3.11/shutil.py", line 436, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib64/python3.11/shutil.py", line 256, in copyfile
    with open(src, 'rb') as fsrc:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'upstreams/httpd/2.4/test/../../test/run-openshift'

Also use f"" syntax instead of .format

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@phracek
Copy link
Member Author

phracek commented Mar 25, 2024

/test

@pkubatrh
Copy link
Member

lgtm

@phracek phracek merged commit 42f7e4b into master Mar 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants