fix some type errors in debug.py

Summary:
D9389865 changed the rel_path variable from a string to a pathlib.Path object.
However it missed a couple places where the path object needed to be converted
to bytes.

Reviewed By: chadaustin

Differential Revision: D9476525

fbshipit-source-id: 2dc69f5a0378ffbc02b2724a097604df288683c9
This commit is contained in:
Adam Simpkins 2018-08-23 11:53:14 -07:00 committed by Facebook Github Bot
parent 6e7b264295
commit 9f6f952024

View File

@ -389,7 +389,7 @@ class InodeCmd(Subcmd):
out = sys.stdout.buffer
instance, checkout, rel_path = cmd_util.require_checkout(args, args.path)
with instance.get_thrift_client() as client:
results = client.debugInodeStatus(bytes(checkout.path), rel_path)
results = client.debugInodeStatus(bytes(checkout.path), bytes(rel_path))
out.write(b"%d loaded TreeInodes\n" % len(results))
for inode_info in results:
@ -655,7 +655,9 @@ class UnloadInodesCmd(Subcmd):
age = TimeSpec()
age.seconds = int(args.age)
age.nanoSeconds = int((args.age - age.seconds) * 10 ** 9)
count = client.unloadInodeForPath(bytes(checkout.path), str(rel_path), age)
count = client.unloadInodeForPath(
bytes(checkout.path), bytes(rel_path), age
)
unload_path = checkout.path.joinpath(rel_path)
print(f"Unloaded {count} inodes under {unload_path}")