summaryrefslogtreecommitdiff
path: root/morphlib/morphloader.py
Commit message (Collapse)AuthorAgeFilesLines
* Validate build-depends in MorphologyLoaderSam Thursfield2014-09-191-5/+14
|
* Fix morphloader to unset_defaults for chunksFrancisco Redondo Marchena2014-08-151-2/+13
|
* Set chunk static default to Nonebaserock/franred/fixes-needed-for-organize-definitionsFrancisco Redondo Marchena2014-08-151-12/+12
|
* Add system-integration to chunk _static_defaultsFrancisco Redondo Marchena2014-08-151-0/+1
|
* Add deploy-defaults before deploy in the MorphologyDumper keyorderFrancisco Redondo Marchena2014-08-151-0/+1
|
* Rename morph3 to morphologyAdam Coldrick2014-08-141-1/+1
| | | | | | Instead of leaving morph3 with a potentially confusing name, rename it to `morphology` since it is now the only implementation of the Morphology class.
* morphloader: Get commands when loading morphologyAdam Coldrick2014-08-141-0/+11
| | | | | | Rather than having a `get_commands` method to obtain missing commands from the build system when they are needed, get the commands when loading a morphology.
* morphloader: Add and remove some default valuesAdam Coldrick2014-08-141-7/+14
| | | | | | | | | This commit stops morphloader setting the `morph` field in chunk specs, and also makes it set defaults for the prefix and build-mode fields. Not setting the `morph` field is necessary as its presence in chunk specs is used by `traverse_morphs` to mean that the morphology file is in the definitions repository, not the chunk source repository. If we set a default value here, we end up looking for files which do not exist.
* Dump multi-line strings in yaml documents in '|' formbaserock/richardmaw/bugfix/yaml-multi-line-dumpRichard Maw2014-07-301-2/+29
| | | | | | | | This prevents the description fields of morphologies being mangled. This does not preserve the original formatting, so much as happen to dump it in the same way we wrote it, but given we chose that form because we think it looks the nicest, that's not a problem.
* Add class hierarchies for Morphology load errorsRichard Maw2014-07-071-28/+36
| | | | | There's a lot of them, it's too much of a pain to enumerate them all, so it's convenient to provide a hierachy and catch the base exceptions.
* Improve var names in morphloaderRichard Ipsum2014-06-241-24/+22
|
* Fix duplicate names error messageRichard Ipsum2014-06-241-5/+6
| | | | | This error message didn't report the cluster morph at fault. We also fix a minor formatting issue.
* Validate cluster morphologiesAdam Coldrick2014-06-181-1/+26
| | | | | The names of deployments in cluster morphologies will need to be unique in order for the deployment of selected systems to work.
* Fix bad indentationRichard Ipsum2014-05-071-2/+2
|
* A more useful morphology syntax error messageRichard Ipsum2014-05-071-4/+3
| | | | | There's no longer any need to log the exception separately, it will be logged with the MorphologySyntaxError
* morphloader: Dump dicts with a nicer key orderRichard Maw2014-02-171-1/+57
|
* Warn and default to null if repo or ref are givenRichard Maw2014-02-131-2/+55
| | | | | | | | | | | | | | | | | | This now means that the system morphology is not altered when chunks are altered, so some tests had to change. Since this uses the python warnings API, these warnings can be ignored by running python -W ignore:"stratum morphology" \ -W ignore:"system morphology" \ "$(which morph)" ...` or turned into errors with python -W error:"stratum morphology" \ -W error:"system morphology" \ "$(which morph)" ...`
* Add validation for chunk refs in strata to be (non-empty) stringsBen Brown2014-01-221-0/+33
|
* MorphologyLoader: Validate new fieldsRichard Maw2014-01-161-6/+110
|
* Replace chunk 'chunks' field with 'products'Richard Maw2014-01-151-2/+2
| | | | | | | | | | | | | | | | | | | I think that it's confusing for both strata and chunk morphologies to have a 'chunks' field, with the former listing sources and the latter listing rules for splitting this source into artifacts. The design for splitting strata has roughly the same idea, but operating on chunk artifact names, rather than file names, so a name that can be used for both was chosen. Splits and artifacts weren't satisfactory names, so they're now called 'products'. It was decided to break backwards compatibility of chunk morphologies being able to specify 'chunks', since the format has changed, so extra code would be required to translate the format, and the only users of the 'chunks' field was the test suite, since there was no way to select from the system, which chunk artifacts were included.
* morphloader: use getattr for validate, set defaultsRichard Maw2013-11-291-16/+5
| | | | It saves some boilerplate.
* morphloader: Require systems have at least one stratumRichard Maw2013-11-291-2/+44
| | | | | | | | | | It doesn't currently make sense to build a system which contains no strata. We may later add other fields, such as initramfs to contribute to the system's artifact, but until then it's another bug to trip over. This uses collections.Sequence for checking the type of the systems entry in the morphology as a style choice, though it allows more flexibility if the types in the parsed morphology change.
* morphloader: Set default values for cluster morphsRichard Maw2013-11-291-3/+19
| | | | | | | | This was omittted from the MorphologyLoader due to cluster morphologies being added at about the same time. This bug escaped detection since the MorphologyLoader was not required to deploy. It soon will be.
* morphloader: Don't use ValueError exceptionRichard Maw2013-11-291-2/+22
| | | | | Dedicated exceptions allow more fine-grained exception catching and can have extra data.
* Merge remote-tracking branch 'origin/danielfirth/RT241'Lars Wirzenius2013-10-081-1/+3
|\ | | | | | | | | Reviewed-by: Lars Wirzenius Reviewed-by: Richard Maw
| * Added 'description' field to static defaults for cluster morphologiesDan Firth2013-10-071-1/+3
| |
* | Merge remote-tracking branch 'origin/danielfirth/RT189'Lars Wirzenius2013-10-081-16/+20
|\ \ | |/ |/| | | Changed the error (exception) to list all obsolete fields.
| * 'system-kind' and 'disk-size' system morphology fields now raise ↵Dan Firth2013-10-011-0/+19
| | | | | | | | ObsoleteFieldError
| * Dropped support for 'system-kind' from system morphology filesDan Firth2013-09-271-15/+0
| |
| * Dropped support for 'disk-size' from system morphology files'Dan Firth2013-09-271-1/+0
|/
* morphloader: Add method to unset default valuesRichard Maw2013-08-301-2/+23
| | | | | | | | | | | | | The original contents of the morphology is not generally trackable, comments are lost for example, and it's simpler to output a canonical format than attempt to preserve everything of the original. However, we don't want to clutter the output with fields that have been filled out to be the defaults, so provide a method to remove fields that are the same as their default. This also removes a check in set_defaults that it is a valid kind, since it explicitly declares it assumes the morphology is valid.
* Add initial code to support clusters in morphloaderTiago Gomes2013-08-161-5/+14
| | | | | | | Although clusters morphologies are still loaded using the old code, `checkout` in the new branch-and-merge plugin tries to load and validate the morphology using morphloader.
* Fix variable nameLars Wirzenius2013-08-161-1/+1
|
* Use isinstance instead of type when checking morphology object typeLars Wirzenius2013-08-151-1/+1
| | | | Suggested by Richard Maw
* Check for empty strata earlierLars Wirzenius2013-08-151-4/+4
| | | | Suggested by Richard Maw
* Fix how stratum empty build deps check is doneLars Wirzenius2013-08-151-1/+1
| | | | | | | The old code, which MorphologyLoader will replace, allows build-mode test as well as bootstrap, so the new code needs to do that too. Suggested by Richard Maw.
* Systematically use spec instead of infoLars Wirzenius2013-08-151-4/+4
| | | | | | | | We don't have a real name for the dict that tells us what chunk (or stratum) to use in a stratum (or system). The code was sometimes using spec, and sometimes info. It now uses spec always. Suggested by Richard Maw
* Rename method to MorphologyLoader.parse_morphology_textLars Wirzenius2013-08-151-3/+5
| | | | | | | The new name is more descriptive, since it turns out that the method doesn't just parse strings, but also open file handles. Suggested by Richard Maw.
* Drop use of explicit StringIO with the yaml moduleLars Wirzenius2013-08-151-5/+2
| | | | | | | It turns out the yaml module can handle strings directly, and does not need explicit file handles. Suggested by Richard Maw.
* Add new morphology abstraction and morphology loading/savingLars Wirzenius2013-08-141-0/+343
The old code is somewhat weird. The new code is meant to be cleaner and more straightforward to understand and to use. For example, the old code has setting of defaults in both the Morphology and MorphologyFactory classes. The new code has a minimally simple Morphology class, and has all the logic to validate and set defaults in the MorphologyLoader class. Further, the new code makes it possible to load an invalid morphology, which will be useful later.