summaryrefslogtreecommitdiff
path: root/morphlib/morphloader.py
Commit message (Collapse)AuthorAgeFilesLines
* Add support for definitions version 8Pedro Alvarez2016-03-291-30/+46
| | | | | | | | | This code is a rework from changes done by: - Tiago Gomes <tiago.gomes@codethink.co.uk> https://storyboard.baserock.org/#!/story/86 Change-Id: I3475c2bcb648a272fee33bc878a521f79d4e6581
* morphloader: simplify APITiago Gomes2016-03-251-31/+15
| | | | | | | Use an optional parameter to control whether the defaults should be set instead of a separate function. Change-Id: Idbbd5a08e8b16d8e01bb9539274092978b64f6f0
* Fix some test failuresSam Thursfield2016-03-031-5/+8
| | | | | | These seem to have been introduced by commit fb6dd955cbc7081f47dc4391. Change-Id: I2fb0be5f8829722264f3509f4db9473d19ea2939
* Fix copyright year of morphlib/morphloader.pybaserock/pedroalvarez/wip-gearPedro Alvarez2016-02-271-1/+1
| | | | | | File was modified in 472dbbbbfa07e67c02a98e9f4ee50fc86ad32b7e Change-Id: If0ffa0aae76ff9f0093e5eb7ff7d74d66c26119d
* Validate empty configure/build/test/install commandsEdward Cragg2016-02-251-0/+13
| | | | | | | | | | | | | If a command in a chunk is evaluated to None when a morphology is loaded, this would previously lead to the subprocess module throwing a 'Coercing to Unicode' error when morph attempts to run the command during the chunk build. This change throws a more helpful error if any commands are not valid strings when the chunk is validated, for example: ERROR: Field configure-commands[217] expected type <type 'str'>, got <type 'NoneType'> in morphology linux-jetson-tk1 Change-Id: I45220e7deab8c7cd9351507bc998f7ff12797442
* morphloader: remove aliasTiago Gomes2015-12-211-6/+5
| | | | | | | The field 'alias' is not defined in the schema for definitions version 7. Change-Id: Id595562258ebe4c3f228cf3f04456e7f69ce63ae
* morphloader: remove unset functionsTiago Gomes2015-12-211-50/+0
| | | | Change-Id: I2a9177245e8cd4eac54ef8a2079eaed2e98e88e7
* morphloader: remove arch normalizationTiago Gomes2015-12-211-5/+0
| | | | | | | It is a non-documented secret sauce and having to type an extra letter for the ARMv7 little-endian architecture does not justify it. Change-Id: I733d1b5a5a5a53ed4dd9815d16b946f9b0a980ec
* morphloader: remove obsolete fieldsTiago Gomes2015-12-211-73/+2
| | | | Change-Id: If7bf7af93eb404be48f752ed64e8b038a3073668
* Add support for Baserock definitions version 7Sam Thursfield2015-10-141-8/+29
| | | | | | | | | | | | | | | | | | | | | | This adds a new 'Defaults' class to represent definitions defaults The Python 'jsonschema' module is used to validate the contents of the Defaults file. This module is already included in Baserock 'build' and 'devel' reference systems by way of the 'openstack-common' stratum. This commit embeds a copy of the JSON-Schema schema for the DEFAULTS file. I think the canonical location of this schema should be in the reference definitions.git, for now. In future, the schemas should maybe have their own repos. Either way, Morph should embed a copy for the time being so that we are sure the schema matches how Morph expects to parse the file. Morph's automated tests are all updated to use definitions version 7. I removed most of the tests for built-in build systems, because the built-ins themselves are no longer part of Morph. Only the mechanism for defining them needs to be tested now. Change-Id: I65f8f1c967683ef605852bfae5c68518e53f9981
* Remove support for Baserock definitions format versions 3, 4 and 5Sam Thursfield2015-09-181-20/+11
| | | | Change-Id: Iad95af65bd5c528d2e72f5b2ffa80a01152f50ff
* Add support for Baserock definitions version 6Sam Thursfield2015-07-291-20/+57
| | | | Change-Id: I891d1b13ed0581b293fe6b09b3cc73af8fd81d67
* morphloader: Allow build-system lookup to be customisedRichard Maw2015-06-121-3/+5
| | | | | | | This defaults to the default, and only useful behaviour at this point. It is there so that tests may mock it out. Change-Id: I17499fc1bb0a1ad39da2ac836a2946b1a0ed5abe
* morphloader: When given definitions v5, include strip commandsRichard Maw2015-06-121-0/+9
| | | | Change-Id: Ib64e4f823de129a3a5a78eb1db6a4e0f6da03928
* morphloader: Hoist buildsystem lookup outside of loopsRichard Maw2015-06-051-6/+6
| | | | Change-Id: If548a9962d5e70480f7eaba6ab6596465975e894
* morphloader: Add test-commands to key orderRichard Maw2015-06-051-0/+3
| | | | Change-Id: I01b3132c9fb27f1c0277ffe5eb0166e489312e38
* MorphologyLoader: Set filename attribute at parse timeRichard Maw2015-05-111-2/+3
| | | | Change-Id: I0e0b8d352eb4ef1ab6c50e0ba0162263d9bac09d
* Raise an error if a stratum build-depends on itselfAdam Coldrick2015-05-081-0/+11
| | | | | | | | | | | | If a stratum build-depends on itself, the build graph calculation gets stuck in an infinite loop as it adds the same stratum to the queue of morphologies to inspect over and over again. This commit causes MorphologyLoader.validate_stratum to raise an error if a stratum contains itself in it's build-depends, as depending on itself makes no sense and will cause the above problem. Change-Id: I76df5b7d63d010ae3b17f72bfa39b273e74279dd
* Use the modern way of the GPL copyright header: URL instead real addressJavier Jardón2015-03-161-2/+1
| | | | Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0
* Do not fail if a chunk doesnt have a 'build-depends' parameter definedjjardon/no_build_dependsJavier Jardón2015-03-041-12/+1
|
* morphlib/morphloader.py: Add a check to load_from_string()Javier Jardón2015-03-041-1/+5
|
* morphlib/morphloader.py: Update copyrigthJavier Jardón2015-03-041-1/+1
|
* 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