|
19 | 19 | from __future__ import absolute_import |
20 | 20 | from __future__ import print_function |
21 | 21 |
|
22 | | -import os |
| 22 | +import logging |
23 | 23 | import struct |
24 | 24 |
|
25 | 25 | from pycdlib import pycdlibexception |
|
35 | 35 | from pycdlib import udf as udfmod # NOQA pylint: disable=unused-import |
36 | 36 |
|
37 | 37 |
|
| 38 | +_logger = logging.getLogger('pycdlib') |
| 39 | + |
| 40 | + |
38 | 41 | class EltoritoBootInfoTable(object): |
39 | 42 | """ |
40 | 43 | A class that represents an El Torito Boot Info Table. The Boot Info Table |
@@ -944,31 +947,19 @@ def hdmbrcheck(disk_mbr, sector_count, bootable): |
944 | 947 | raise pycdlibexception.PyCdlibInvalidInput('Boot image has multiple partitions') |
945 | 948 |
|
946 | 949 | if bootable and status != PARTITION_STATUS_ACTIVE: |
947 | | - # genisoimage prints a warning in this case, but we have no other |
948 | | - # warning prints in the whole codebase, and an exception will probably |
949 | | - # make us too fragile. So we leave the code but don't do anything. |
950 | | - with open(os.devnull, 'w') as devnull: |
951 | | - print('Warning: partition not marked active', file=devnull) |
| 950 | + _logger.warning('Warning: partition not marked active') |
952 | 951 |
|
953 | 952 | cyl = ((s_seccyl & 0xC0) << 10) | s_cyl |
954 | 953 | sec = s_seccyl & 0x3f |
955 | 954 | if cyl != 0 or s_head != 1 or sec != 1: |
956 | | - # genisoimage prints a warning in this case, but we have no other |
957 | | - # warning prints in the whole codebase, and an exception will probably |
958 | | - # make us too fragile. So we leave the code but don't do anything. |
959 | | - with open(os.devnull, 'w') as devnull: |
960 | | - print('Warning: partition does not start at 0/1/1', file=devnull) |
| 955 | + _logger.warning('Warning: partition does not start at 0/1/1') |
961 | 956 |
|
962 | 957 | cyl = ((e_seccyl & 0xC0) << 10) | e_cyl |
963 | 958 | sec = e_seccyl & 0x3f |
964 | 959 | geometry_sectors = (cyl + 1) * (e_head + 1) * sec |
965 | 960 |
|
966 | 961 | if sector_count != geometry_sectors: |
967 | | - # genisoimage prints a warning in this case, but we have no other |
968 | | - # warning prints in the whole codebase, and an exception will probably |
969 | | - # make us too fragile. So we leave the code but don't do anything. |
970 | | - with open(os.devnull, 'w') as devnull: |
971 | | - print('Warning: image size does not match geometry', file=devnull) |
| 962 | + _logger.warning('Warning: image size does not match geometry') |
972 | 963 |
|
973 | 964 | system_type = parttype |
974 | 965 |
|
|
0 commit comments