OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 """ | 2 """ |
3 Program that calculates several hashes for a given CD image. | 3 Program that calculates several hashes for a given CD image. |
4 | 4 |
5 @copyright: Red Hat 2008-2009 | 5 @copyright: Red Hat 2008-2009 |
6 """ | 6 """ |
7 | 7 |
8 import os, sys, optparse, logging | 8 import os, sys, optparse, logging |
9 import common | 9 import common |
10 import kvm_utils | 10 import kvm_utils |
11 from autotest_lib.client.common_lib import logging_config, logging_manager | 11 from autotest_lib.client.common_lib import logging_manager |
12 from autotest_lib.client.bin import utils | 12 from autotest_lib.client.bin import utils |
13 | 13 |
14 | 14 |
15 if __name__ == "__main__": | 15 if __name__ == "__main__": |
16 parser = optparse.OptionParser("usage: %prog [options] [filenames]") | 16 parser = optparse.OptionParser("usage: %prog [options] [filenames]") |
17 options, args = parser.parse_args() | 17 options, args = parser.parse_args() |
18 | 18 |
19 logging_manager.configure_logging(kvm_utils.KvmLoggingConfig()) | 19 logging_manager.configure_logging(kvm_utils.KvmLoggingConfig()) |
20 | 20 |
21 if args: | 21 if args: |
(...skipping 17 matching lines...) Expand all Loading... |
39 | 39 |
40 logging.info("Hash values for file %s", os.path.basename(filename)) | 40 logging.info("Hash values for file %s", os.path.basename(filename)) |
41 logging.info("md5 (1m): %s", utils.hash_file(filename, 1024*1024, | 41 logging.info("md5 (1m): %s", utils.hash_file(filename, 1024*1024, |
42 method="md5")) | 42 method="md5")) |
43 logging.info("sha1 (1m): %s", utils.hash_file(filename, 1024*1024, | 43 logging.info("sha1 (1m): %s", utils.hash_file(filename, 1024*1024, |
44 method="sha1")) | 44 method="sha1")) |
45 logging.info("md5 (full): %s", utils.hash_file(filename, method="md5")) | 45 logging.info("md5 (full): %s", utils.hash_file(filename, method="md5")) |
46 logging.info("sha1 (full): %s", utils.hash_file(filename, | 46 logging.info("sha1 (full): %s", utils.hash_file(filename, |
47 method="sha1")) | 47 method="sha1")) |
48 logging.info("") | 48 logging.info("") |
OLD | NEW |