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

CP-49922: mv scripts/probe-device-for-file to python3/libexec #5720

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install:
$(IPROG) libexec/usb_reset.py $(DESTDIR)$(LIBEXECDIR)
$(IPROG) libexec/usb_scan.py $(DESTDIR)$(LIBEXECDIR)
$(IPROG) libexec/nbd_client_manager.py $(DESTDIR)$(LIBEXECDIR)
$(IPROG) libexec/probe-device-for-file $(DESTDIR)$(LIBEXECDIR)

$(IPROG) bin/hfx_filename $(DESTDIR)$(OPTDIR)/bin
$(IPROG) bin/perfmon $(DESTDIR)$(OPTDIR)/bin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
# (c) Anil Madhavapeddy, Citrix Systems Inc, 2008
# Checks for the existence of a file on a device

import os, sys
import os
import sys

try:
import xenfsimage
import xenfsimage
except ImportError:
import fsimage as xenfsimage
import fsimage as xenfsimage
from contextlib import contextmanager


# https://stackoverflow.com/a/17954769
@contextmanager
def stderr_redirected(to=os.devnull):
Expand All @@ -33,16 +36,16 @@ def stderr_redirected(to=os.devnull):
with open(to, 'w') as file:
_redirect_stderr(to=file)
try:
yield # allow code to be run with the redirected stderr
yield # allow code to be run with the redirected stderr
finally:
_redirect_stderr(to=old_stderr) # restore stderr.
# buffering and flags such as
# CLOEXEC may be different

if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: %s <device> <file>" % sys.argv[0])
sys.exit(2)
print("Usage: %s <device> <file>" % sys.argv[0])
sys.exit(2)
device = sys.argv[1]
file = sys.argv[2]
try:
Expand Down
1 change: 0 additions & 1 deletion scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ install:
$(IPROG) print-custom-templates $(DESTDIR)$(LIBEXECDIR)
$(IPROG) backup-sr-metadata.py $(DESTDIR)$(LIBEXECDIR)
$(IPROG) restore-sr-metadata.py $(DESTDIR)$(LIBEXECDIR)
$(IPROG) probe-device-for-file $(DESTDIR)$(LIBEXECDIR)
$(IPROG) backup-metadata-cron $(DESTDIR)$(LIBEXECDIR)
$(IPROG) pbis-force-domain-leave $(DESTDIR)$(LIBEXECDIR)
mkdir -p $(DESTDIR)/etc/sysconfig
Expand Down
Loading