Move md5sum implementation to fs_utils
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
@@ -21,11 +21,7 @@ class File(FsItem):
|
||||
return fs_utils.diff(str(self), str(other_file))
|
||||
|
||||
def md5sum(self, binary=True):
|
||||
output = TestRun.executor.run(
|
||||
f"md5sum {'-b' if binary else ''} {self.full_path}")
|
||||
if output.exit_code != 0:
|
||||
raise Exception(f"Md5sum command execution failed! {output.stdout}\n{output.stderr}")
|
||||
return output.stdout.split()[0]
|
||||
return fs_utils.md5sum(str(self), binary)
|
||||
|
||||
def read(self):
|
||||
return fs_utils.read_file(str(self))
|
||||
|
Reference in New Issue
Block a user