diff options
author | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2013-04-11 12:19:57 +0300 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2013-04-19 16:27:40 +0300 |
commit | 724a1aa53546d55df97a9d08740287b4335eeaad (patch) | |
tree | 2cd36544dc5619d1f0344d9540b3bd47410a20b9 | |
parent | 666a3b525f13998c17c5937219d948d72ea9d5cf (diff) | |
download | mic-724a1aa53546d55df97a9d08740287b4335eeaad.tar.gz mic-724a1aa53546d55df97a9d08740287b4335eeaad.tar.bz2 mic-724a1aa53546d55df97a9d08740287b4335eeaad.zip |
gpt_parser: improve naming some more
Use "raw_" prefix for the on-disk data to make the code more readable.
Change-Id: I644f6250ddc3f6483910b94242f06c49c64b5e75
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
-rw-r--r-- | mic/utils/gpt_parser.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mic/utils/gpt_parser.py b/mic/utils/gpt_parser.py index 4f7efa3..84ecd10 100644 --- a/mic/utils/gpt_parser.py +++ b/mic/utils/gpt_parser.py @@ -196,22 +196,22 @@ class GptParser: index = -1 for _ in xrange(0, header['parts_cnt']): - entry = self._read_disk(start, _GPT_ENTRY_SIZE) - entry = struct.unpack(_GPT_ENTRY_FORMAT, entry) + raw_entry = self._read_disk(start, _GPT_ENTRY_SIZE) + raw_entry = struct.unpack(_GPT_ENTRY_FORMAT, raw_entry) start += header['entry_size'] index += 1 - if entry[2] == 0 or entry[3] == 0: + if raw_entry[2] == 0 or raw_entry[3] == 0: continue - part_name = str(entry[5].decode('UTF-16').split('\0', 1)[0]) + part_name = str(raw_entry[5].decode('UTF-16').split('\0', 1)[0]) yield { 'index' : index, - 'type_uuid' : _stringify_uuid(entry[0]), - 'part_uuid' : _stringify_uuid(entry[1]), - 'first_lba' : entry[2], - 'last_lba' : entry[3], - 'flags' : entry[4], + 'type_uuid' : _stringify_uuid(raw_entry[0]), + 'part_uuid' : _stringify_uuid(raw_entry[1]), + 'first_lba' : raw_entry[2], + 'last_lba' : raw_entry[3], + 'flags' : raw_entry[4], 'name' : part_name, 'primary' : primary } |