~mabac/linaro-image-tools/hwpacks-v2-lmc

« back to all changes in this revision

Viewing changes to linaro_image_tools/hwpack/config.py

  • Committer: Mattias Backman
  • Date: 2011-06-29 07:18:40 UTC
  • Revision ID: mattias.backman@linaro.org-20110629071840-cjf8mjshucyy0zvg
Change test to use variable for matching text.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    MMC_ID_KEY = "mmc_id"
60
60
    FORMAT_KEY = "format"
61
61
 
 
62
    DEFINED_PARTITION_LAYOUTS = [
 
63
        'bootfs16_rootfs',
 
64
        'bootfs_rootfs',
 
65
        #'reserved_bootfs_rootfs',
 
66
        ]
 
67
 
 
68
 
62
69
    def __init__(self, fp):
63
70
        """Create a Config.
64
71
 
375
382
        pass
376
383
 
377
384
    def _validate_partition_layout(self):
378
 
        defined_partition_layouts = [
379
 
            'bootfs16_rootfs',
380
 
            'bootfs_rootfs',
381
 
            #'reserved_bootfs_rootfs',
382
 
            ]
383
 
        if self.partition_layout not in defined_partition_layouts:
 
385
        if self.partition_layout not in self.DEFINED_PARTITION_LAYOUTS:
384
386
            raise HwpackConfigError(
385
387
                "Undefined partition layout %s in the [%s] section. "
386
388
                "Valid partition layouts are %s."
387
389
                % (self.partition_layout, self.MAIN_SECTION,
388
 
                   ", ".join(defined_partition_layouts)))
 
390
                   ", ".join(self.DEFINED_PARTITION_LAYOUTS)))
389
391
 
390
392
    def _validate_mmc_id(self):
391
393
        mmc_id = self.mmc_id